태지쌤

로봇 & 코딩교육 No.1 크리에이터

파이썬/exercise

4-2. python nested list 보물지도

태지쌤 2023. 1. 3. 15:53
반응형

 

# 🚨 Don't change the code below 👇
row1 = ["⬜️","⬜️","⬜️"]
row2 = ["⬜️","⬜️","⬜️"]
row3 = ["⬜️","⬜️","⬜️"]
map = [row1, row2, row3]
print(f"{row1}\n{row2}\n{row3}")
position = input("Where do you want to put the treasure? ")
# 🚨 Don't change the code above 👆

#Write your code below this row 👇
position_int = int(position)
column = position_int // 10
row = position_int % 10
map[row-1][column-1] = "X"

#Write your code above this row 👆

# 🚨 Don't change the code below 👇
print(f"{row1}\n{row2}\n{row3}")

반응형