Question
PYTHON: Ask user to enter his/her age. If the age is less than 18, display You are not eligible to vote. If it is 18,
PYTHON:
Ask user to enter his/her age. If the age is less than 18, display You are not eligible to vote. If it is 18, display You need to register. If it is bigger than 18, display You can vote
Sample Output:
Please enter your age 12
You are not eligible to vote
Please enter your age 18
You need to register
Please enter your age 33
You can vote
#2
Write a program to play the guess the number game. The computer will pick a number between 1 and 100 and the user will try to guess the number in as few guesses as possible.
Input: The user will enter a guess until the correct guess is entered
The program will keep asking for a guess until the correct guess is entered. The program will also give hints to the user (number is too high, or too low)
Output:
The program will output the number of guesses. Below is a sample run of how the program should proceed:
Im thinking of a number between1-100
Can you guess what the number is?
Enter your guess
50
Too Low!
Enter your guess
75
Too low!
Enter your guess
87
Too low!
Enter your guess
93
You win!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started