Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # hw10.py
- import random
- player1=input('1플레이어의 이름은? ')
- player2=input('2플레이어의 이름은? ')
- print(' ')
- i, dice1, dice2 = 1, 0, 0
- while True:
- print(i, '라운드')
- dice=random.randint(1, 6)
- dice1+=dice
- print(player1, '는(은) %d가(이) 나왔습니다. 현재 위치: %d' %(dice, dice1))
- dice=random.randint(1, 6)
- dice2+=dice
- print(player2, '는(은) %d가(이) 나왔습니다. 현재위치: %d' %(dice, dice2))
- print(' ')
- if dice1>=30:
- print(i, '라운드만에', player1, '가(이) 이겼습니다.')
- break
- elif dice2>=30:
- print(i, '라운드만에', player2, '가(이) 이겼습니다.')
- break
- i+=1
Add Comment
Please, Sign In to add comment