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
- Mae
- 논문editor
- python 갯수세기
- 스택
- TypeError
- MAPE
- RMES
- 코테
- KAKAO
- mes
- 에러해결
- PAPER
- 파이썬을파이썬답게
- Scienceplots
- 평가지표
- 카카오
- Alignments
- iNT
- Tire
- Pycaret
- 논문작성
- 프로그래머스
- knn
- n_neighbors
- Overleaf
- SMAPE
- mMAPE
- n_sample
- 논문
- Python
Archives
- Today
- Total
EunGyeongKim
[Python] int 진법 변환 시 에러 본문
n진법 -> 10진법으로 변환시 에러
num, base = map(int, input().strip().split(' '))
int(num, base)
이런식으로 n진법을 10진법으로 변환해줄때
----> print(int(num, base))
TypeError: int() can't convert non-string with explicit base
type에러가 나타난다.
num이 string이 아니라서 생기는 문제!
걍 num을 str형태로 바꿔주면 된다!
에러 수정 코드
num, base = map(int, input().strip().split(' '))
int(str(num), base)
에러 해결 끝! :D
'Language > Python' 카테고리의 다른 글
[Python] 유클리드 호제법 (0) | 2022.09.06 |
---|---|
[데이터 구조 및 분석] Linked List 코드 (0) | 2022.08.12 |
[paper] Matplotlib으로 논문용 figure그리기 (1) | 2022.08.10 |
[Python] collection모듈의 counter (0) | 2022.08.09 |
[프로그래머스] 파이썬을 파이썬답게 정리 (0) | 2022.08.04 |
Comments