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](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/02/65c3576848a58_71265c35768243ec.jpg)
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
Get step-by-step solutions from verified subject matter experts
