Network disconnected
Description
enumerate
를 이용해서 무지개의 순서와 색을 출력하도록 빈칸을 채워보세요.
enumerate
는 리스트가 있는 경우 순서와 리스트의 값을 전달하는 기능을 합니다. 아래의 예를 참고하여 문제를 해결해 보세요.
names = ['철수', '영희', '영수']
for i, name in enumerate(names):
print('{}번 : {}'.format(i + 1, name))
이 예제의 출력값은 아래와 같습니다.
1번 : 철수
2번 : 영희
3번 : 영수
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
rainbow=["빨","주","노","초","파","남","보"]
for i,color in :
print('{}번째 색은 {}'.format(i+1,color))
Result
Stop
Result of [Run Test] or [Submit] will be displayed here
내가 제출한 코드가 왜 틀렸는지 프로그래머스 AI에게 물어보세요.
제출 후 채점하기를 눌러 30점 이상인 경우 물어볼 수 있어요.
베타 기간 동안에는 한 문제당 1번만 물어볼 수 있어요.
베타 기간 동안에는 한 문제당 1번만 물어볼 수 있어요.