Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- index = 0
- words = ""
- realmaps = []
- final = 0
- def isNum(s):
- try:
- int(s)
- return True
- except ValueError:
- return False
- for line in open("bzfile.txt"):
- words += line
- for word in words.split():
- if(word == 'Maps'):
- realmaps.append(prevword)
- prevword = word
- for num in realmaps:
- print(num)
- if(isNum(num)):
- final += int(num)
- print("Maps played: " + str(final))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement