This assignment involves writing a program that takes reads from a text file containing multiple lines of floating numbers separated by commas. The program will ask for the
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
Thank you!
The same homework with different requirements(below). what is code?
Ask user to enter file containing floating point numbers
Open and read file into a list of strings and assign to lines
For each line in lines
Split the line into individual floating point numbers and assign to tokens
Assign 0 to total
Assign first number to smallest
Assign first number to largest
For each token in tokens
Convert to a floating point number and assign to number
Add number to total
If number is less than smallest, assign number to smallest
If number is greater than largest, assign number to largest
Calculate average
Display total, average, smallest number, largest number
when I run geany, it showed"
File
file = open("input.txt", "r")
FileNotFoundError: [Errno 2] No such file or directory: 'input.txt'", how to fix it ?