+ 1
Can someone help with that code?
i wanna open a text file in python and count the lines of the text. i wrote that code with no effect. can someone tell me whats wrong? textfile=open("ab.txt", "r") lines= textfile.readlines() x=0 for line in lines: x=x+1 print(x) After that i wanna delete for every line of the text any numbers which are in the form (123456)(123456)
2 Answers
+ 3
count = len(textfile.readlines())
- 1
length = count = len(textfile.readlines())
print(len)