157k views
9 votes
Write code that does the following: opens an output file with the filename number_ list.txt, uses a loop to write the numbers 1 through 100 to the file, then closes the file.

User Tanzaho
by
6.4k points

1 Answer

5 votes

Answer:

6

Step-by-step explanation:

# create the file

filemane= "Testfile.txt"

# for writing, we create the iutput file:

output = open(filename, "w")

#Writibg numbers from 1-100

for item in range 1,101):

User TamusJRoyce
by
6.8k points