
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
스니팻 복사하고 코딩 그대로 따라서 파이썬에 쳐봤는데 에러뜹니다 ㅠ
작성한 코드 및 에러 메세지
# "8zerothree2" → 8032
# "seven73nine" → 7739
# "two53eightfour" → 25384
s1 = "8zerothree2"
s2 = "seven73nine"
s3 = "two53eightfour"
def solution(s):
num_dict = {
"zero": "0",
"one": "1",
"two": "2",
"three": "3",
"four": "4",
"five": "5",
"six": "6",
"seven": "7",
"eight": "8",
"nine": "9",
}
for str in num_dict:
s = s.replace(str,num_dict[str])
answer = int(s)
return answer
print(solution(s1))
print(solution(s2))
print(solution(s3))
아래는 에러 메시지임다
C:\Users\82108\AppData\Local\Programs\Python\Python312\python.exe C:\Users\82108\Desktop\algorithm_note\Algorithm\eng_quiz.py
File "C:\Users\82108\Desktop\algorithm_note\Algorithm\eng_quiz.py", line 10
num_dict = {
^
IndentationError: expected an indented block after function definition on line 9
Process finished with exit code 1
