일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
Tags
- 파이썬
- MyPlaylist
- BFS
- 데이터베이스
- DP
- 백준
- Planned
- 함밥
- SQL
- 종합설계
- django
- 프로그래머스
- 동적계획법
- 마라마라빔
- 백트래킹
- DFS
- minimum spanning tree
- Kruskal
- 코드트리
- 최소스패닝트리
- 소프트웨어공학
- 그리디알고리즘
- 실습
- 모각코
- codetree
- 알고리즘
- 장고
- B대면노래방
- Bellman-Ford
- programmers
Archives
- Today
- Total
Leta Learns
[Python] Intermediate Low - Basic #단순 반복문 본문
#단순 반복문
- 19단 출력 https://www.codetree.ai/missions/2/concepts/1/problems/nineteen-times-table/description
for i in range(1, 20):
for j in range(1, 20, 2):
if j == 19:
print(i,"*",j,"=",i*j)
else:
print(i,"*",j,"=",i*j,"/",i,"*",(j+1),"=",i*(j+1))
- 별 그리기 https://www.codetree.ai/missions/2/concepts/1/problems/star-drawing/description
n = int(input())
for i in range(0, n):
print(" "*(n-(i+1)),end='')
print("*"*((2*i)+1))
for i in range(0, n):
print(" "*(i+1),end='')
print("*"*((2*n)-(2*i)-3))
- 약수의 개수가 3개인 수 https://www.codetree.ai/missions/2/concepts/1/problems/square-of-prime-number/description
start, end = map(int, input().split())
candidate = []
count = 0
for i in range(start, end+1):
for j in range(2, i):
if i % j == 0:
candidate.append(i)
for i in candidate:
if candidate.count(i) == 1:
count += 1
print(count)
- 숫자 뒤집기 https://www.codetree.ai/missions/2/concepts/1/problems/flip-integer/description
natural = input()
natural_1 = natural
for i in range(len(natural)):
if natural[-1] == '0':
natural = natural.replace(natural[-1], "")
if natural_1[i] != '0':
print(natural[len(natural)-i-1],end='')
'Coding > codetree' 카테고리의 다른 글
[Python] Intermediate Low - DP (0) | 2021.08.13 |
---|---|
[Python] Intermediate Low - DFS , BFS (0) | 2021.08.11 |
[Python] Intermediate Low - Basic #최대 최소 (0) | 2021.08.03 |
Comments