Untitled
unknown
python
2 years ago
1.1 kB
7
Indexable
results = [] for i in range(6): move = input() results.append([move[0], move[1]]) scores = [0, 0] won_recently = None for move in results: if move[0] == "W" or move[1] == "W": index = 0 if move[0] == "W" else 1 other_index = 1 if index == 0 else 0 if move[other_index] == "W": if won_recently is not None: scores[won_recently] = 0 else: if move[other_index] == "W": won_recently = index else: scores[index] += 1 elif move[0] == "R": if move[1] == "P": scores[1] += 1 elif move[1] == "S": scores[0] += 1 elif move[0] == "P": if move[1] == "S": scores[1] += 1 elif move[1] == "R": scores[0] += 1 elif move[0] == "S": if move[1] == "R": scores[1] += 1 elif move[1] == "P": scores[0] += 1 print(f"{scores[0]}-{scores[1]}") print(f"{scores[0]}-{scores[1]}")
Editor is loading...