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

Practical File9class

practical file9class, practical file9class

Uploaded by

akanksha gupta
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)
20 views2 pages

Practical File9class

practical file9class, practical file9class

Uploaded by

akanksha gupta
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

PRACTICAL FILE

Q1 Input two number from user and find their sum


num1=int (input("enter first number:"))
num2=int (input("enter second number:"))
sum=num1+num2
print("the sum is:", sum)
Q2 To take length and width of a Rectangle as input, and find its perimeter and area.
l=int(input("enter first number:"))
b=int(input("enter second number:"))
peri=2 * ( l + b)
area=l * b
print("the Perimeter of Rectangle is:", peri)
print("the Area of Rectangle is:", area)
Q3 To take side of a Square as input, and find its perimeter and area.
side=int(input("enter side of a square :"))
peri=4 * side
area=side * side
print("the Perimeter of a square is:", peri )
print("the Area of a square is:", area)
Q4 To take sides of a Triangle as input, and find its perimeter.
side1 = int(input("enter side1 of a triangle :"))
side2 = int(input("enter side 2 of a triangle :"))
side3 = int(input("enter side 3 of a triangle :"))
peri= side1+ side2+ side3
print("the Perimeter of a triangle is:", peri )
Q5 Write a program to check whether the given number is positive or not.
num=int(input("enter any number:"))
if num>=0:
print("positive or zero")
else:
print("negative number")
Q6 Write a program to check whether the given number is fully divisible by 5 or not.
num=int(input("enter any number:"))
if num%5==0:
print("the number input is fully divisible by 5 ")
else:
print("the number input is not fully divisible by 5 ")

Q7 Write a program to check whether the given number is odd or even.


num=int(input("enter any number:"))
if num%2==0:
print("the number input is even number ")
else:
print("the number input is odd number ")

Q8 Write a program to input 5 numbers from the user and check whether their sum is greater
than 480 or not.
num1=int (input("enter first number:"))
num2=int (input("enter second number:"))
num3=int (input("enter third number:"))
num4=int (input("enter fourth number:"))
num5=int (input("enter fifth number:"))
sum=num1+num2+num3+num4+num5
if sum>=480:
print("the sum of five numbers is Greater than/Equal to 480")
else:
print("the sum of five numbers is less than 480")

Q9 Write a program to input 2 numbers from the user and print the smaller one.
num1=int (input("enter first number:"))
num2=int (input("enter second number:"))
if num1>=num2:
print("num1 is greater")
else:
print("num2 is greater")

Q10 Write a program to check that if a person’s age is greater than or equal to 18, then print “You
are eligible for vote”, otherwise print “You are not eligible for vote”.
age=int (input("enter your age: "))
if age>=18:
print("you are eligible to vote")
else:
print("you are not eligible to vote")

Q11 Write the python Code to calculate the Simple Interest

principle_amount =int(input("enter the principal amount"))


roi = float(input("enter the rate of interest"))
time= float(input("enter the time"))
simple_interest = (principle_amount * roi * time)/100
print("datatype of principle amount : ", type(principle_amount))
print("datatype of rate of interest : ", type(roi))
print("datatype of simple interest : ", type(simple_interest))
print("value of simple interest : ", simple_interest)

You might also like