|
|
back to boardPython-runtime_error Why does this code throw a runtime error? Everything is right!! from sys import stdin pocht_1 = ["A", "P", "O", "R"] pocht_2 = ["B", "M", "S"] pocht_3 = ["D", "G", "J", "K", "T", "W"] count = 0 mesto = 1 for i in sys.stdin.split("\n")[1:]: if i[0] in pocht_1: if mesto == 3: count += 2 elif mesto == 2: count += 1 mesto = 1 elif i[0] in pocht_2: if mesto == 1: count += 1 elif mesto == 3: count += 1 mesto = 2 else: if mesto == 1: count += 2 elif mesto == 2: count += 1 mesto = 3 print(count) |
|
|