Network disconnected
Description
products의 상품명과 값을 한 줄씩 출력하도록 코드의 4번째줄의 빈칸을 채워 보세요.
튜플로 리턴하기 위해 리스트나 딕셔너리를 이용할 수 있습니다. 딕셔너리의 items()
를 이용하여 튜플을 리턴할 때에는 *
를 사용할 수 있습니다. 아래의 예제를 살펴보고 문제를 해결해 보세요.
ages = {'Tod' : 35, 'Jane' : 23, 'Paul' : 62}
for a in ages.items():
print('{}의 나이는:{}'.format(a[0], a[1]))
for a in ages.items():
print('{}의 나이는:{}'.format(*a)) # 두 출력 결과가 같습니다.
Question type: Fill in the blank
- You need to fill in the blank with the appropriate code.
- You cannot modify the given code.
- An error message will appear in the result if you leave the blank empty.
1
2
3
4
products = {"풀" : 800, "색종이": 1000}
for product_detail in products.items():
print("{}의 가격: {}원".format( ))
Result
Stop
Result of [Run Test] or [Submit] will be displayed here
내가 제출한 코드가 왜 틀렸는지 프로그래머스 AI에게 물어보세요.
제출 후 채점하기를 눌러 30점 이상인 경우 물어볼 수 있어요.
베타 기간 동안에는 한 문제당 1번만 물어볼 수 있어요.
베타 기간 동안에는 한 문제당 1번만 물어볼 수 있어요.