Created
March 24, 2015 04:46
-
-
Save joshenders/421526ae868c0f4bea78 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> a = "1.0" | |
>>> int(a) | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
ValueError: invalid literal for int() with base 10: '1.0' | |
>>> int(float(a)) | |
1 | |
>>> foo = "1.0" | |
>>> int(foo) | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
ValueError: invalid literal for int() with base 10: '1.0' | |
>>> int(float(foo)) | |
1 | |
>>> a = "1" | |
>>> int(a) | |
1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment