Professional Documents
Culture Documents
programing
1. #write a program to read a number a and b and find the greatest of the two
numbers
80 is greater than60
A=input("Enter your first number")
B=input("Enter your second number")
if(A>B):
print("{0} is greater than{1}".fprmat(A,B))
else:
print("{0} is greater than{1}".format(B,A))
3.#write a program to read the age of a person and check whether he is eligible to
vote (hint : If age more than 18 he is allowed to vote)
Age=int(input("Enter your age"))
if(Age>18):
print("you are eligible to vote")
else:
print("you are not eligible to vote")
4.# A dice is thrown, and the outcome can be either 1,2,3,4,5 or 6. Write a program
to read the outcome and if it is 1, 5 or 6 then allow the person to throw the dice
one more time