Answer to Question #59978 in Python for fahad awan

Question #59978
Use this website to solve the problem http://cscircles.cemc.uwaterloo.ca/6-if/

Coding Exercise: Age checker
Write a program that reads an integer from input, representing someone's age. If the age is 18 or larger, print out You can vote. If the age is between 0 and 17 inclusive, print out Too young to vote. If the age is less than 0, print out You are a time traveller.
1
Expert's answer
2016-05-16T07:40:37-0400
tmp = int(input("input age : "))
if tmp > 17 : print ("You can vote")
elif 0 <= tmp <= 17 : print ("Too young to vote")
else : print ("You are a time traveller")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS