Program 1
Find out greater among 2 user given numbers
num1=int(input("Enter your first number:"))
num2=int(input("Enter your second number: "))
if num1>num2 :
print(num1,'is greater from',num2)
else:
print(num2,'is greater than',num1)
Program 2
Find out an user given number is divisible by 5 or not
number = int(input(" Please Enter any Positive Integer : "))
if number % 5 == 0 :
print("Given Number is Divisible by 5 ")
else :
print("Given Number is Not Divisible by 5 ")
Program 3
Find out an user given number is odd or even
number = int(input(" Please Enter any Positive Integer : "))
if number % 2 == 0 :
print(number,"is even")
else :
print(number,"is odd")
Program 4
Find out an user given number is positive or negative
num=int(input("Enter your first number:"))
if num>0 :
print(num,'is positive')
else:
print(num,'is negative')
Program 5
Convert Fahrenheit to Celsius
temperature = float(input("Please enter temperature in Fahrenheit:"))
celsius = (temperature - 32) * 5 / 9
print("Temperature in Celsius: " , celsius)
Program 6
Calculation of simple interest
principal = float(input('Enter the principle amount: '))
time = float(input('Enter the time: '))
rate = float(input('Enter the rate: '))
simple_interest = (principal*time*rate)/100
print("Simple interest is:", simple_interest)
Program 7
Store items in a list and display it’s content using for loop
For I in X :
Print(X)
PROGRAM 8
Find out the remainder of two user given numbers.
A=67
B=9
C=A%B
print('The remainder is',C)
PROGRAM 9
Print the area of a square
side = int(input('Enter the value: '))
print('the area of the square is',side*side)
Program 10
Store a following object in a list and display the items store in the 4 th position of the list.
X=[4,9,5,'abc',23,9]
print(X[4])