User input and if-else condition in python


##Alamgir, CSE, JUST
#If-else-ifelse condition check in python-----------
f = input("Enter the first value : ")
s = input("Enter the second value : ")

print "Press 1 for add, 2 for sub, 3 for mul, 4 for div 5 for remainder : "c = input()

if c==1:
    print "Addition of the thw number is : ",(f+b)
elif c==2:
    print "Subtraction of the two number is : ",(f-s)
elif c==3:
    print "Multiplication of the two number is : ",(f*s)
elif c==4:
    print "Division of the two number is : ",(f/s)
elif c==5:
    print "Remainder of the two number is : ",f%s
else:
    print "Please enter the valid input-----------"
print "Thank you!!!!!!!!!!!!!!!!!!"

No comments:

Post a Comment