Question
Write a Python script that does the following: Asks the user to type an integer. The script should continue to prompt the user for a
Write a Python script that does the following:
-
Asks the user to type an integer. The script should continue to prompt the user for a number until the user types a valid integer.
-
Using the modulo operation (%), calculates the modulus of the user's integer divided by 3.
-
Determines the user's "lucky animal" based on the modulus you calculated in the previous step. You get to decide
what the lucky animals will be.
-
Prints a message telling the user about their lucky animal.
Here's an example of what a session of your program might look like (user's responses are in bold):
Please enter an integer: x Please enter an integer: 8 Your lucky animal is the albatross
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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