Question: a . Ask the user to input his / her age. Check whether the age is equal to or greater than 1 8 . if

a. Ask the user to input his/her age. Check whether the age is equal to or greater than 18. if so, print "You can vote ". If not, print "Sorry, you are not eligible". (hint: remember that Python firsts takes user input as string type. So, you may have to change it to numerical type by using "int" or "float" function.
b. Can you modify the program such that if the age is not 18 yet than the program prints "You hi to wait x years "? Where x is the number of years left for the user to be 18.
Use the following Syntax to write if-else code:
If(candition):
Volue if True
Volve if False
 a. Ask the user to input his/her age. Check whether the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!