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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!