Question: Specification The script must define 4 functions random_number_file_create lines_print lines_count total_numbers_in_file random_number_file_create This functions must have the following header def random_number_file_create(min, max, filename, entries): This

Specification The script must define 4 functions random_number_file_create lines_print lines_count total_numbers_in_file random_number_file_create This functions must have the following header def random_number_file_create(min, max, filename, entries): This function must create a file where each line has a pseudorandom number. Each of these numbers must between the values of the parameters min and max. The name of the file is given by the parameter filename. The number of lines in the file is given by the parameter entries. The function must close the file after it has written all the values. lines_print This functions must have the following header def lines_print(filename): This function must print each line of the file. There should be no blank lines between the lines of the file. The function must close the file after it has printed all the lines. lines_count This functions must have the following header def lines_count(filename): This function must count the number of lines in the file and return that total. The function must close the file after it has read all the lines. total_numbers_in_file This functions must have the following header def total_numbers_in_file(filename): This function must calculate the total of all the numbers in the file and return that total. The function must close the file after it has read all the lines. Run code At the bottom of the script you must have the following code FILENAME = "numbers.txt" random.seed(83) random_number_file_create(50, 100, FILENAME, 20) lines_print(FILENAME) print() entries = lines_count(FILENAME) total = total_numbers_in_file(FILENAME) average = round(total/entries) print("Entries:", entries) print("Total:", total) print("Average:", average) The code above will run the functions you create, and make it easier for me to score this assignment. Testing When you run your script the output should look exactly like this 81 79 55 58 74 52 53 91 63 62 61 69 55 53 76 59 72 69 85 62 Entries: 20 Total: 1329 Average: 66

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