Question: Open the file oddsw.txt using a with context. The file should contain the odd numbers you created on a previous assignment. Read the numbers
Open the file "oddsw.txt using a with context. The file should contain the odd numbers you created on a previous assignment.
Read the numbers in and display the sum of the numbers on the file. Add to my code to call "int" to change string to number in a for a con: from BrowserFile import open
with openoddswtxtw as f:
for n in range:
fwritestrn
with openoddswtxtr as f:
totalsum sumintlinestrip for line in f
printtotalsum
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
