0 of 1 Questions completed
Questions:
You have already completed the practice exercise before. Hence you can not start it again.
Practice Exercise is loading…
You must sign in or sign up to start the practice exercise.
You must first complete the following:
0 of 1 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
Question: Create a program that asks the user for an input by asking “What is your age in years?”. Save the user’s age as a variable. Following the question, print whether or not they’re eligible for a driver’s license in the output (assuming 16 years old is minimum age). The user should be warned if they enter a negative number. Check out the GIF below to see how it should work:
Fill in the program below!
age = int(input(“What is your age in years?”))
print(“You cannot enter a negative age!”)
print(“You are younger than 16 and are not eligible for a drivers license.”)
print(“You are 16 or older and eligible for a drivers license.”)
HINT #1: The user’s input is not a string, it’s an integer. Forget how to write an input that returns an integer rather than a string? Check out the input() function …with integers template on the last page of your Python Cheat Sheet for some help!
HINT #2: Forget how to print something in the output? Check out the print() function template on the last page of your Python Cheat Sheet for some help!