Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started