subject
Computers and Technology, 16.11.2020 17:50 9444

Write a Python program that uses function(s) for writing to and reading from a file: a. Random Number File Writer Function
Write a function that writes a series of random numbers to a file called "random. txt". Each random number should be in the range of 1 through 500. The function should take an argument that tells it how many random numbers to write to the file.
b. Random Number File Reader Function
Write another function that reads the random numbers from the file "random. txt", displays the numbers, then displays the following data:
The total of the numbers
The number of random numbers read from the file
c. Main Function
Write a main function that asks the user about how many random number the user wants to generate. It them calls the function in a. with the number the user wants as an argument and generates random numbers to write to the file. Next, it calls the function in b.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 21:00
So im doing this school challenge and the teachers said whats the average text a student gets a day so i need to get about 20 in a day but dont know how can you guys 2163371293
Answers: 2
question
Computers and Technology, 23.06.2019 01:00
Petrică, tânăr licean în clasa a ix-a, a primit în dar de la părinţii săi un cont bancar pentru micile sale cheltuieli curente. el este pasionat de internet banking şi îşi verifică cu grijă toate tranzacţiile efectuate. pentru creşterea securităţii tranzacţiilor online, banca îi furnizează lui petrică un număr pe care el va trebui să îl modifice, obţinând un număr tan – număr de autentificare a tranzacţiei (transaction authentication number). regula de obţinere a numărului tan este următoarea: se formează cel mai mic număr par din toate cifrele numărului furnizat de bancă. cerinţă cunoscând numărul n furnizat de bancă, să se determine numărul tan obţinut de petrică. date de intrare fişierul tan.in conţine pe prima linie numărul natural n cu semnificaţia din enunţ. date de ieşire fişierul de ieşire tan.out va conţine o singură linie pe care va fi scris numărul tan cerut. restricţii • 0 < n < 18*1018 • n are cel puţin o cifră pară • numărul tan obţinut nu poate conţine zerouri nesemnificative
Answers: 2
question
Computers and Technology, 23.06.2019 23:30
What are "open-loop" and "closed-loop" systems
Answers: 1
question
Computers and Technology, 25.06.2019 20:30
Question 1 excel is a tool used to a create a spreadsheet b design a brochure c make a presentation d write a letter question 2 a cell on an excel spreadsheet refers to a a type of document view b a page of the workbook c the rectangular box where a column and row intersect d the data in a worksheet question 3 tanya is entering the amount of money she has earned from babysitting onto an excel spreadsheet, but the autocomplete feature is not working. why? a autocomplete must be turned on before every entry. b autocomplete only works with professional spreadsheets. c autocomplete does not recognize types of currency. d autocomplete only works when the first character is text. question 4 which tab has formatting features to change the font style, color, size, and alignment? a file b home c insert d view question 5 brad uses excel to create a weekly schedule. he wants to keep using the same spreadsheet every year. one of his rows is titled "baseball," but the season has ended until next year. what is the most efficient way to modify the spreadsheet, so brad does not see baseball on his schedule but can easily get it back when the season starts again? a add a new comment with the start date of the next season b hide the row and unhide it when the new season begins c highlight the row in a different color to show the season has ended d start a new spreadsheet
Answers: 1
You know the right answer?
Write a Python program that uses function(s) for writing to and reading from a file: a. Random Numb...
Questions
question
Mathematics, 19.01.2021 18:10
question
Mathematics, 19.01.2021 18:10
Questions on the website: 13722363