0% found this document useful (0 votes)
8 views2 pages

Python Programs Term i - Gr 10

Uploaded by

DHYANA V
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Python Programs Term i - Gr 10

Uploaded by

DHYANA V
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

To calculate discounted amount with discount


amt=int(input("Enter the amount"))
dis=float(input("Enter the discount in percentage"))
disamt=amt*dis/100
amtaft=amt-disamt
print("The discount is:",disamt)
print("The amount after discount is:",amtaft)

2. To calculate the Surface area and volume of a cuboid


l=int(input("Enter the length"))
w=int(input("Enter the breadth"))
h=int(input("Enter the height"))
surarea=2*l*w+2*l*h+2*h*w
volume=l*w*h
print("The surface area is:",surarea)
print("The volume of a cuboib is:",volume)

3. Write a program to check whether a number is odd or even.

num = int(input("enter the number?"))


if num%2 == 0:
print("Number is even...")
else:
print("Number is odd...")

4. Write a Python program to find the largest among the three numbers.

num1 = 10
num2 = 14
num3 = 12
#num1 = float(input("Enter first number: "))
#num2 = float(input("Enter second number: "))
#num3 = float(input("Enter third number: "))
if (num1 >= num2) and (num1 >= num3):
largest = num1
elif (num2 >= num1) and (num2 >= num3):
largest = num2
else:
largest = num3
print("The largest number is", largest)

5. Write a Python program to find whether the given number is positive, negative
or zero using nested if statement.

num=float(input("Enter a number"))
if num >=0:
if num==0:
print("Zero")
else:
print("Positive number")
else:
print("negative number")

You might also like