강의

멘토링

커뮤니티

Inflearn Community Q&A

heewon2218921's profile image
heewon2218921

asked

Introduction to Python Algorithm Problem Solving (Coding Test Preparation)

2. Extract only numbers

오류원인?

Written on

·

93

0

파이썬 decimal() 함수를 모르는 상태에서

if i == '0' or i == '1' or i == '2' or i == '3' or i == '4' or i == '5' or i == '6' or i == '7' or i == '8' or i == '9':

tmp+=i

int(tmp)

이렇게 코드를 짰다고 했을때

ValueError: invalid literal for int() with base 10:

오류가 뜹니다.. 숫자만 골라서 int 형변환 했는데 왜 오류가 뜰까요..?

 

 

python코딩-테스트

Answer

This question is waiting for answers
Be the first to answer!
heewon2218921's profile image
heewon2218921

asked

Ask a question