Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Copy the same read / looping code from # 1 or # 2 and then create a new file with each number higher by 1
Copy the same readlooping code from # or # and then create a new file with each number higher by add ten to each number before writing it to a new file in numbers.txt
The new file can have any name.
from ast import Return
from pickle import APPEND
file opengoogledrivepath "numbers.txtr
lines
newfile opengoogledrivepath "newfile.txtw
for line in file:
lines.appendlinerstrip
newlines int line.rstrip
for in lines:
newfile.write
newfile.close
file.close
This is the code I have done so far and it outputs a new file but kept the same numbers from the original file instead of adding to each number in the list
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