감소시키며 출력하기 2
i = 26
while i >= 10:
print(i, end=" ")
i -= 1
n부터 1까지 정수 출력
https://www.codetree.ai/missions/4/problems/print-n-to-1?&utm_source=clipboard&utm_medium=text
n = int(input())
while n >= 1:
print(n, end=" ")
n -= 1
짝수만 출력 2
https://www.codetree.ai/missions/4/problems/output-only-even-2?&utm_source=clipboard&utm_medium=text
i = input().split()
b,a = int(i[0]), int(i[1])
n = b
while n >= a:
print(n, end=" ")
n -= 2
'코딩테스트 > 프로그래밍 기초 | 단순 반복문' 카테고리의 다른 글
[코드트리] if 안의 for (0) | 2024.12.30 |
---|---|
[코드트리] n번 반복하기 (0) | 2024.12.29 |
while문 a → b 2씩 증가 (0) | 2024.12.27 |
[코드트리] while문 a → b 1씩 증가 (0) | 2024.12.27 |
[코드트리] for문 b → a 1씩 감소 (0) | 2024.12.27 |