Professional Documents
Culture Documents
If Else: Int Input
If Else: Int Input
# input age
age = int(input("Enter Age : "))
# finding sum
sum = num1 + num2
# printing sum
print( sum )
7. num = int (input (“Enter any number to test whether it is odd or even:
“)
if (num % 2) == 0:
else:
Program 7. Python program to check whether the entered character is vowel or consonant.
# A list of numbers
list = [19, 10, 45, 26, 6]
if op==’+’:
elif op==’-‘:
print(“Subtraction is : ”, num1-num2)
elif op==’*’:
print(“Multiplication is : ”, num1*num2)
elif op==’/’:
print(“Division is “, num1/num2)
else:
print(“Wrong operator”)
# list of numbers.
My_List1=[1,2,3,4,5]
print(My_List1)
#List of string.
print(My_List2)
Program 11. Program to find the area of a rectangle.
print(“Area= ”, area)