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