250x250
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
- 슬라이싱
- ORDER BY
- 아이엠어바텐더
- List Comprehension
- Python3
- Django
- Len
- 파이썬
- html
- YOLOv5
- 파이썬 몫
- 백준
- 프로그래머스
- 파이썬 슬라이싱
- css
- where
- GIT
- Join
- 설계
- sql
- pcce 기출문제
- count
- python
- 코딩테스트 연습
- map
- date_format
- 데이터
- 프로젝트
- SQL 고득점 Kit
- 단어 공부
Archives
- Today
- Total
nan + nan = 2nan
[백준] [Python3] #1330. 두 수 비교하기 본문
728x90
코드 입력
A, B = (input().split())
if int(A) > int(B):
print('>')
elif int(A) < int(B):
print('<')
else:
print('==')
A, B = map(int, input().split())
if A > B:
print('>')
elif A < B:
print('<')
else:
print('==')
앞 단원에서 배운 map 함수와 split을 활용했다.
if 문을 사용할 때는 : 와 들여쓰기를 확실히 해줘야 한다는 점.
출처 : 백준 Online Judge
https://www.acmicpc.net/problem/1330
1330번: 두 수 비교하기
두 정수 A와 B가 주어졌을 때, A와 B를 비교하는 프로그램을 작성하시오.
www.acmicpc.net
'Python > 백준 알고리즘' 카테고리의 다른 글
[백준] [Python3] #2753. 윤년 (0) | 2021.08.03 |
---|---|
[백준] [Python3] #9498. 시험 성적 (0) | 2021.08.03 |
[백준] [Python3] #2588. 곱셈 (0) | 2021.08.03 |
[백준] [Python3] #10430. 나머지 (0) | 2021.08.03 |
[백준] [Python3] #10869. 사칙연산 (0) | 2021.08.03 |
Comments