Question: 20. [3 marks] Given the code below to open a file: some_file = open('test.txt', 'r'). Explain the return value for the following statements (note

20. [3 marks] Given the code below to open a file: some_file

20. [3 marks] Given the code below to open a file: some_file = open('test.txt', 'r'). Explain the return value for the following statements (note the s in the second method name). a. some_file.readline() b. some_file.readlines () 21.[8 marks] Write the missing client code program, jungle.py. Given the class Animal (animal.py) and the data file jungle_data.txt, write code for a main program in jungle.py that produces the output below. Note: As always, your code should work properly for a different data file. The random animal is randomly selected. In the file jungle_data.txt, the animals are in no particular order and thirsty animal is denoted with a *. Output: There are 9 animals in the Jungle and (4 are thirsty). The maximum distance of an animal from the well is 40.00Km You have animals from these 3 species: Snake, Wolf, Rabbit Today's random animal is: Rabbit 0.50Km (True)

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 Programming Questions!