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')
1
Expert's answer
2016-05-26T13:36:03-0400
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')
Learn more about our help with Assignments: Python
Comments
Assignment Expert
14.04.21, 14:34
Dear Hsein dika please post a new question
hsein dika
14.04.21, 08:34
Write a program that prompts the user to enter 4 odd integers and
finds their min, max, and sum, then outputs the square root of such
sum Output Sample Run 1 Enter odd integer values: -9 81 789 5 The
minimum is -9 The maximum is 789 Their sum is 866 The square root of
866 is 29.43
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
Thank you! Your comments have been successfully added. However, they need to be checked by the moderator before being published.
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Dear Hsein dika please post a new question
Write a program that prompts the user to enter 4 odd integers and finds their min, max, and sum, then outputs the square root of such sum Output Sample Run 1 Enter odd integer values: -9 81 789 5 The minimum is -9 The maximum is 789 Their sum is 866 The square root of 866 is 29.43
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!
Helped me out massively, thanks!
Leave a comment