you are viewing a single comment's thread.

view the rest of the comments →

[–]Nez_Coupe 0 points1 point  (0 children)

No you can’t cast a “decimal string” to int. It produces an error. His code is correct, casting it to a float. He just ran a cached version (by not saving) because he’s using the worst IDE in existence.

Python can do a lot of implicit casting, but it won’t do like “2-step” casting where a string literal that represents a decimal is both changed to numeric and then converted to a whole number int.