- 가위바위보 게임
money=10000
while True:
배팅액=int(input('얼마를 배팅하시겠습니까?'))
money=money-int(배팅액)
print('계좌:',money)
if 0 > money:
money=10000
print('돈이 부족합니다')
continue
나=input('가위 / 바위 / 보:')
import random
menu=(random.choice(['가위','바위','보']))
print("상대:",menu)
if 나 not in '가위' '바위' '보':
print('가위 / 바위 /보만 입력하세요')
나=input('가위 / 바위 / 보:')
'가위'<'바위'
'바위'<'보'
'보'<'가위'
if 나 == menu:
print('비겼습니다')
while True:
나=input('가위 / 바위 / 보:')
import random
menu=(random.choice(['가위','바위','보']))
print("상대:",menu)
if 나 not in '가위' '바위' '보':
print('가위 / 바위 /보만 입력하세요')
나=input('가위 / 바위 / 보:')
'가위'<'바위'
'바위'<'보'
'보'<'가위'
if 나 == menu:
print('비겼습니다')
elif menu=='가위' and 나== '바위' or menu=='바위' and 나== '보' or menu=='보' and 나== '가위':
print('이겼습니다')
money=money+배팅액*2
continue
else:
print('졌습니다')
배팅액=0
continue
elif menu=='가위' and 나== '바위' or menu=='바위' and 나== '보' or menu=='보' and 나== '가위':
money=money+배팅액*2
print('이겼습니다')
else:
배팅액=0
print('졌습니다')
if money==0:
break