Advertisement
Guest User

Untitled

a guest
Apr 19th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. word=input("vilket ord söker du?: ")
  2.  
  3. file=open("klasslista.txt", "r")
  4. file_contents = file.read()
  5. counter=0
  6. for i in file_contents:
  7.     file_contents.find(word)
  8.     if file_contents.find(word)==True:
  9.         counter = 1 + counter
  10.     print(counter)
  11. print(counter)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement