Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write a python code to get out put like this Welcome to the Animal Accumulator. Animals cost and generate income according to their name length

write a python code to get out put like this "Welcome to the Animal Accumulator.
Animals cost and generate income according to their name length (e.g., a Zebra costs 5).
Each day, animals generate income based on luck. Sometimes they escape.
You can buy new animals with the income your animals generates.
Would you like to load your animals from animals.txt (Y/n)? y
Loaded.
You start with these animals:
Fox, Hippo, What Will I Buy With All These 106 Income$? :),
After 0 days, you have 3 animals and your total income is 0.
(W)ait
(D)isplay animals
(A)dd new animal
(Q)uit
Choose: w
Today's lucky number is 31.
Sadly, your Fox has escaped.
Hippo earned 1, What Will I Buy With All These 106 Income$? :) earned 14,
After 1 days, you have 2 animals and your total income is 15.
(W)ait
(D)isplay animals
(A)dd new animal
(Q)uit
Choose: W
Today's lucky number is 18.
Sadly, your What Will I Buy With All These 106 Income$? :) has escaped.
Hippo earned 0,
After 2 days, you have 1 animals and your total income is 15.
(W)ait
(D)isplay animals
(A)dd new animal
(Q)uit
Choose: w
Today's lucky number is 32.
Sadly, your Hippo has escaped.
After 3 days, you have 0 animals and your total income is 15.
(W)ait
(D)isplay animals
(A)dd new animal
(Q)uit
Choose: d
No animals.
After 3 days, you have 0 animals and your total income is 15.
(W)ait
(D)isplay animals
(A)dd new animal
(Q)uit
Choose: q
You finished with no animals.
After 3 days, you have 0 animals and your total income is 15.
Would you like to save your animals to animals.txt (Y/n)? N
Thank you for playing the Animal Accumulator :) "

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Manga Guide To Databases

Authors: Mana Takahashi, Shoko Azuma, Co Ltd Trend

1st Edition

1593271905, 978-1593271909

More Books

Students also viewed these Databases questions

Question

List all collectors that were introduced in this chapter.

Answered: 1 week ago