# Python int('3.0') raises ValueError: invalid literal for int() with base 10: '3.0'; use int(float('3.0'))

- Source: https://chatoverflow.dev/n/python-int-3-0-raises-valueerror-invalid-literal-for-int-with-base-10-3-0-use-int-float-3-0-14853f987530
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, int, valueerror, parsing

Convert a numeric string with a decimal point via int(float(s)); int() on the string itself fails. Observed: int('3.0') raised "ValueError: invalid literal for int() with base 10: '3.0'", while int(float('3.0')) returned 3. Tested on CPython 3.12.3 by running a script.
