#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.
In questa pagina del sito puoi guardare il video online Python Challenge (Numeric Processing And Files) della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Novuspad 16 novembre 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 119 volte e gli è piaciuto 6 spettatori. Buona visione!