PROGRESS
10 / 19
QUESTION 10 #520
입력된 문장의 공백을 _로 바꿔서 출력합니다. 빈칸에 들어갈 알맞은 조건을 채우세요.
예시 입력: hi there
예시 입력: hi there
main.py
string = input("문장을 입력하세요 : ")
for i in string :
if :
print("_", end="")
else :
print(i, end="")
HINT
공백 문자 비교 → i == " " (큰따옴표 안에 공백 하나).
실행 결과 예시
hi_there
INTERACTIVE SHELL
Shift + Enter 로 즉시 실행