Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- answers = "A\nB"
- file = open('answers.txt', 'w')
- file.write(answers)
- file.close()
- def quiz(a,b):
- count = 0
- j = []
- with open("answers.txt","r") as answers_file:
- for i in answers_file:
- options = i.strip()
- j.append(options)
- if j[0] == a and j [1] == b:
- count = 100
- elif j[0] != a and j[1] == b:
- count = 50
- elif j[0] == a and j[1] != b:
- count = 50
- else:
- count = 0
- print(count)
- a = input()
- b = input()
- quiz(a,b)
Add Comment
Please, Sign In to add comment