Question: Consider the following main.py script. what is the output when the script main.py is executed ? def write ( n ) : f = open

Consider the following main.py script. what is the output when the script main.py is executed ?
def write(n):
f = open ('data.txt','a')
f. write(str(n))
f.close()
def add
_to_file(a,b) :
S =0
for e in range(a,b) :
s= e-a
write(s)
5=0
def read):
f = open('data.txt', r')
print(f.read())
f.close()
add_to_file(1,6)
read()
01111
01234
012345
1234

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!