- 1
Fill in the blanks to read the content of a file called "records.txt" and output the number of characters it has.
Hello, i need your help to solve this application: f=open("records.txt","r") cont = f.read() print( (cont)) f.close(() What I should put in the space between print and cont?I have read all theory and I tried but nothing works.Could you give me an idea please?Thank you!
7 Answers
+ 2
f=open("records.txt","r")
cont = f.read()
print( len (cont))
f.close(()
+ 1
len() to count number of character of a string.
0
you also may want to use the full path for the file name and use the correct amount of parenthesis in f.close()
0
Thank you so much for for answers
0
Can someone say the answer? I don't understand
0
Thuwayba Ahmed so go through the lesson again or ask your own specific question. We don't just tell you the answer you have to figure it out yourself as the OP did.
0
print(len(cont))