# Scientific Programming in Python
# Best Practice Exercise
# Author: Nicola Chiapolini

from random import *
k = []
def fun():
    u=randint(0., 10)
    v=randint(0., u)
    w=randint(0., u-v)
    while (v,w)in k:
     u=randint(0., 10)
     v=randint(0., u)
     w=randint(0., u-v)
    k.append((v,w))
    r=int(input(f"{v} + {w} = "))
    if v + w == r:
     print("✓")
     return 1
    else:
     print("✗")
     return    0.

def main(N):
    t = 0

    for _ in range(N):

        t  +=fun()

    print(f"{t} out of {N} correct answers.")

    if t  ==N:

        print("Perfect!")

    elif t/N>=0.8:

        print("Well done!")

if __name__ == "__main__":

    main(10)
