64 713
Assignments Done
99,4%
Successfully Done
In September 2018

Answer to Question #60037 in Python for Waleed Jamshid

Question #60037
Use this website to solve it: 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. You guys give me this Solution but I am keep getting an error.

tmp = int(input())
if tmp > 17:
print ("You can vote")
elif 0 <= tmp <= 17:
print ("Too young to vote")
print('You are a time traveller')
Expert's answer
age = int(input())
age
if age > 17:
print ("You can vote")
elif 0 <= age<= 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

Assignment Expert
04.04.17, 08:08

Dear O.K.,

You're welcome. We are glad to be helpful.
If you liked our service please press like-button beside answer field. Thank you!

O.K.
03.04.17, 17:46

Helped me out massively, thanks!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions