https://replit.com/@hipi-noyenoye/day-4-3-exercise#main.py
# 🚨 Don't change the code below 👇
row1 = ["⬜️", "⬜️", "⬜️"]
row2 = ["⬜️", "⬜", "⬜️"]
row3 = ["⬜️", "⬜", "⬜️"]
map1 = [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 👇
left_str = int(position[0])
right_str = int(position[1])
map1[right_str - 1][left_str - 1] = "X" /// 여기서 내가 헤멘게 단순 행과 열을 바꾸는 거였다는게 ㅠㅠ. 첨에 나는 [left_str -1]을 먼저 썻더니 자꾸 행열이 바꿔서 나오잖아ㅠㅠ..... 단순히 순서만 바꾸면 되는걸. 이것만 했음 다 하는건데!
**그리고 진짜 웃겼던게.... 리스트 내용을 어떤 특정 값으로 바꾸고 싶었는데!...뭐 insert고 뭐고 막 찾았는데
그냥 = "x" 쓰면 되는거라는게.................. ㅋㅋㅋㅋ
#Write your code above this row 👆
# 🚨 Don't change the code below 👇
print(f"{row1}\n{row2}\n{row3}")
'10. 개발 > Python' 카테고리의 다른 글
파이썬 input은 항상 string으로 나옵니당~ (0) | 2022.08.02 |
---|---|
파이썬 100days_4일차 가위바위보 출력하기 (0) | 2022.08.01 |
파이썬_랜덤 모듈 불러오기_python random module (0) | 2022.08.01 |
파이썬 modulo와 if else 활용한 윤년 계산기 (0) | 2022.07.30 |
if와 els및 조건 연산자_python 부트캠프 100days_day3 (0) | 2022.07.30 |