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 | 29 | 30 |
Tags
- SuNiNaTas
- 인코그니토
- Web Hacking
- 문자열
- xcz.kr
- CTF
- MySQL
- wargame
- N0Named
- 구현
- Incognito
- php
- Python
- 정렬
- Forensics
- Web
- misc
- writeup
- 백준
- 그리디 알고리즘
- HackCTF
- 사칙연산
- Network
- Text
- 수학
- Digital Forensics
- 써니나타스
- C
- cryptography
- Database
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