Question: Write a program with two functions: write_file and add_numbers . The write_file function will accept an integer and write that many random numbers between 1
Write a program with two functions: write_file and add_numbers. The write_file function will accept an integer and write that many random numbers between 1 and 30 inclusive to file randnumbers.txt. The add_numbers function will return the total of the numbers in the randnumbers.txt file. The main function will print the total. Sample output might be:
[Sample input/output]
The total is 307
NOTE: This is beginner Python we are nowhere near advanced methods, still in the basics without any shortcuts. I've been at this problem all day and can't figure out a way to solve this at all. Any help is greatly appreciated.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
