Untitled

 avatar
unknown
python
5 months ago
304 B
15
Indexable
myfile = open('what_is_python.txt ', 'r')
line = myfile.readline()
counter = 0
while line != '':
    print(line)
    
    
    for word in line.split():
        # print(word)
        
        if word == 'Python':
            counter += 1 
    line = myfile.readline()
    
print(counter)   
Editor is loading...
Leave a Comment