감소시키며 출력하기
https://www.codetree.ai/missions/4/problems/decrease-and-print?&utm_source=clipboard&utm_medium=text
for i in range(17, 4, -1):
print(i, end=" ")
특정 숫자 도달하기 2
n = int(input())
for n in range(n, 0, -1):
print(n, end=" ")
b부터 a까지 감소
https://www.codetree.ai/missions/4/problems/dec-from-b-to-a?&utm_source=clipboard&utm_medium=text
i = input().split()
a,b = int(i[0]), int(i[1])
for i in range(b, a-1, -1):
print(i, end=" ")
홀수만 출력 2
https://www.codetree.ai/missions/4/problems/output-only-odd-2?&utm_source=clipboard&utm_medium=text
i = input().split()
b, a = int(i[0]), int(i[1])
for i in range(b, a-1, -2):
print(i, end=" ")
'코딩테스트 > 프로그래밍 기초 | 단순 반복문' 카테고리의 다른 글
[코드트리] while문 b → a 1씩 감소 (0) | 2024.12.27 |
---|---|
while문 a → b 2씩 증가 (0) | 2024.12.27 |
[코드트리] while문 a → b 1씩 증가 (0) | 2024.12.27 |
[코드트리] for문 a → b 2씩 증가 (1) | 2024.12.26 |
[코드트리] for문 a → b 1씩 증가 (0) | 2024.12.26 |