PYTHON3
PLEASE USE CORRECT INDENTATION FOR THE
CODING
This is Mr. Poppins, and he's a princess. That's my problem
generally, but today, it's yours too. He randomly decides on a whim
if he wants wet or dry food. The thing is, the type of wet or dry
isn't enough, the brand he desires always changes. This results in
me offering him between 1 - let's say 8 kinds of food every meal.
The amount he eats each time is random too, so he must be fed
multiple times a day (like 8). Anyway do the following:
Create a 2 collections of food, wet and dry. Each collection
should have several brands of food (4 each)
Program some cat logic (Random selection) where Poppins will
secretly choose what he wants to eat between the 2 collections.
A user should then try to guess what food he wanted. If correct,
Poppins was fed 1 meal. If incorrect, but the type is correct (you
both chose a dry food, but not the same dry food), Poppins is fed
1/2 a meal. If the type, and brand are wrong, he skips the meal.
Either way, remove that choice from its collection.
Poppins should RANDOMLY decide if he wants 4 - 6 feedings.
However, in order for the user to do an acceptable job, they must
succeed in their selections at least 50% of the time.
Every time a player must guess, Mr. Poppins should have made
another new random selection (remember, he's annoying).
You must include error handling as well. Hint: Two methods you
might thank me for isdigit(), and isalpha()
Also, remember, he's a good boy!
PYTHON3 PLEASE USE CORRECT INDENTATION FOR THE CODING This is Mr. Poppins, and he's a princess. That's my problem genera
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
PYTHON3 PLEASE USE CORRECT INDENTATION FOR THE CODING This is Mr. Poppins, and he's a princess. That's my problem genera
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!