import random

my = 0 #나의 현재 위치
com = 0 #컴퓨터의 현재 위치
goal = 20 #최종 목적지
winner = 0

while True:
    my_turn = random.randint(1, 6)
    com_turn = random.randint(1, 6)
    my = my + my_turn
    com = com + com_turn
    if my > 20 or com > 20:
        if my > 20:
            winner = '나'
        elif com > 20:
            winner = '컴퓨터'
        break

print('승자는', winner, '입니다')

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: