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