-Code
while True:
player1 = input()
player2 = input()
res_p1, res_p2 = 0, 0
if player1 == player2 == 'E':
break
for i in range(len(player1)):
if player1[i] == 'R' and player2[i] == 'S':
res_p1 += 1
elif player1[i] == 'S' and player2[i] == 'P':
res_p1 += 1
elif player1[i] == 'P' and player2[i] == 'R':
res_p1 += 1
elif player1[i] == 'S' and player2[i] == 'R':
res_p2 += 1
elif player1[i] == 'P' and player2[i] == 'S':
res_p2 += 1
elif player1[i] == 'R' and player2[i] == 'P':
res_p2 += 1
print(f"P1: {res_p1}")
print(f"P2: {res_p2}")
'Beakjoon&프로그래머스 > 파이썬' 카테고리의 다른 글
[백준/파이썬] 10540번 KLOPKA (0) | 2023.05.17 |
---|---|
[백준/파이썬] 5948번 Bad Random Numbers (0) | 2023.05.16 |
[백준/파이썬] 23738번 Ресторан (0) | 2023.05.14 |
[백준/파이썬] 12174번 #include <Google I/O.h> (0) | 2023.05.13 |
[백준/파이썬] 24510번 시간복잡도를 배운 도도 (0) | 2023.05.12 |