Recent posts

Python ValueError: invalid literal for int() with base 10 해결 방법

3 minute read

변환하려는 문자열이 유효한 정수인지 확인하여 Python의 ‘ValueError: invalid literal for int()’를 해결합니다. 안전한 변환을 위해 try-except 블록을 사용하고, str.isdigit() 메서드로 유효성을 검사하는 법을 배웁니다.