Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Python
- 인코그니토
- php
- N0Named
- Forensics
- Digital Forensics
- C
- Network
- 써니나타스
- xcz.kr
- 그리디 알고리즘
- CTF
- 백준
- cryptography
- Web
- 구현
- 정렬
- wargame
- Text
- misc
- writeup
- SuNiNaTas
- 사칙연산
- 문자열
- 수학
- Database
- Web Hacking
- HackCTF
- Incognito
- MySQL
Archives
- Today
- Total
보안을 그리다, 훈이
[Baekjoon/Python3] 4470번 줄번호 본문
[Baekjoon/Python3] 4470번 줄번호
4470번: 줄번호
텍스트에서 줄을 입력받은 뒤, 줄 번호를 출력하는 프로그램을 작성하시오.
www.acmicpc.net
n = int(input())
for i in range(n):
string = input()
print('{}. {}'.format(i + 1, string))
# enumerate() 함수 사용시
n = int(input())
string = [input() for i in range(n)]
for i, v in enumerate(string): # enumerate(iterable 'not int') <-> range('int')
print('{}. {}'.format(i + 1, v))
'Programming > Python & Data Structures' 카테고리의 다른 글
[Baekjoon/Python3] 4641번 Doubles (0) | 2020.12.04 |
---|---|
[Baekjoon/Python3] 4504번 배수 찾기 (0) | 2020.12.04 |
[Baekjoon/Python3] 4458번 첫 글자를 대문자로 (0) | 2020.12.04 |
[Baekjoon/Python3] 4344번 평균은 넘겠지 (0) | 2020.12.04 |
[Baekjoon/Python3] 4153번 직각삼각형 (0) | 2020.12.04 |
Comments