summaryrefslogtreecommitdiff
path: root/comp/work/21/results.py
blob: bfd2d2fbd1b93ad9fc8690d7d610473b3bc8ebbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
results = []

more = "yes"

while more.lower() == "yes":
    result = 0
    tmp = []
    while True:
        result = int(input("result: "))
        if result == -1:
            break
        if result < 0:
            print("invalid input")
        elif result > 100:
            print("invalid input")
        else:
            tmp.append(result)
    results.append(tmp)
    more = input("add results for another student? ")

for i in range(len(results)):
    print("student",i+1,"got: ", *results[i])