dice = [1, 6, 2, 5, 4, 3]
direction = ["남", "동", "북"]

for i in direction:
    if i == "남":
        dice[0], dice[1], dice[2], dice[3] = dice[2], dice[3], dice[1], dice[0]
    elif i == "동":
        dice[0], dice[1], dice[4], dice[5] = dice[4], dice[5], dice[1], dice[0]
    elif i == "북":
        dice[0], dice[1], dice[4], dice[5] = dice[4], dice[5], dice[1], dice[0]
    elif i == "서":
        dice[0], dice[1], dice[4], dice[5] = dice[5], dice[4], dice[0], dice[1]

print(dice[1])

Embed on website

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