Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in python The Island of Dr. Moreau You are Dr. Moreau and you will randomly create 20 bizarre animals. Each animal should have the following:

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
in python
The Island of Dr. Moreau You are Dr. Moreau and you will randomly create 20 bizarre animals. Each animal should have the following: A head randomly chosen from this list: snake, bull, lion, raven, bunny A body made up of two animals randomly chosen using the petname library A random number of arms; must be an even number and between 2-10, inclusive A random number of legs; must be a multiple of three and between 3-12, inclusive A random number of legs; must be a multiple of three and between 3-12, inclusive A non-random number of tails that is equal to the sum of arms and legs Each of the 20 individual animals should be accessible from a list of dictionaries. Use the json library to dump your data structure into an animals.json file. For example, your assembled data structure may look like: { "animals": [ { "head": "snake", "body"; "sheep-bunny", "arms": 2, "legs": 12, look like: { "animals": [ { "head": "snake", "body"; "sheep-bunny", "arms": 2, "legs": 12, "tail": 14 }, { "head" : "snake", "body": "parrot-bream", "arms" : 6, "legs": 6, "tail": 12 }, etc Next, create a new Python script to read in animals.json and print the details of one animal at random to screen That folder should contain three files: generate_animals.py, which generates animals.json animals.json, which contains 20 bizarre animals as described above read_animals.py, which reads animals.json and prints one animal at random to screen

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

Oracle PL/SQL Programming Database Management Systems

Authors: Steven Feuerstein

1st Edition

978-1565921429

More Books

Students also viewed these Databases questions