728x90
출처 : 반크_세계유산 석굴암
참고풀이]
print("1. while Loop로 프로그램 작성하기")
i=0
while i<50:
i+=1
if i%2==0:
print(i,end=" ")
print('\n')
print("2. while Loop로 프로그램 작성하기")
i=0
while i<50:
i+=2
print(i,end=" ")
print('\n')
print("3. while Loop로 프로그램 작성하기")
i=0
while True:
i+=1
if i>50:
break
if i%2==0:
print(i,end=" ")
print('\n')
print("4. for Loop로 프로그램 작성하기")
for i in range(1,51):
if i%2==0:
print(i,end=" ")
print('\n')
print("5. for Loop로 프로그램 작성하기")
for i in range(2,51,2):
print(i,end=" ")
print('\n')
참고풀이 결과]
대한민국의 아름다운 영토, 독도
반응형
'프로그램 > Python 1000제' 카테고리의 다른 글
Python 75제] 년월일 입력하면 요일을 출력하기. (0) | 2022.05.13 |
---|---|
Python 74제] 숫자 맞추기 게임을 만드시오.(Ver 1) (0) | 2022.05.04 |
Python 72제] 파이썬 EXPRESS p193 도전문제 (0) | 2022.04.29 |
Python 71제] 파이썬 EXPRESS p192 도전문제 (0) | 2022.04.29 |
Python 70제] 삽입정렬을 사용하여 오름차순 프로그램을 작성하시오. (0) | 2022.04.29 |
댓글