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
Get step-by-step solutions from verified subject matter experts
