#python #pythonchallenges #files
In this video we will cover some python challenges, and how to solve them. However these challenges are made to test you, and help build your skills so please try to solve them before watching this video!
Hope this helps solidify your knowledge on files, and numeric processing with files, and hope you enjoy the video!
Twitter: / bitwizard8
Discord: / discord
Program Description: Numeric Processing
In this assignment, we will be utilizing functions to read and write data to files. Attached to the
assignment is the file “random.txt” (https://pastebin.com/xBB706tr). This file contains an unspecified amount of random numbers, with
each number entered on its own line.
Behavior:
Your task is to create separate functions to perform the following operations:
1. Read all numbers from the file and display them to the screen
2. Count the amount of numbers stored in the file and display to the screen
3. Calculate the sum of all numbers in the file and display to the screen
4. Calculate the average of all numbers in the file and display to the screen
5. Write the results from the prior functions (amount, sum, average) to a separate file named
“result.txt”
Each function should be executed in the order listed above at runtime, without the need for user
interaction.
The structure and overall design of each function is left up to you, as long as the intended functionality
is accomplished.
Also be sure to implement docstrings for each function to provide proper documentation.
Смотрите видео Python Challenge (Numeric Processing And Files) онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Novuspad 16 Ноябрь 2020, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 104 раз и оно понравилось 5 людям.