Converting from str type to int type is easy to see and unexpectedly error-prone. In this article, I have summarized the points to be aware of when converting from str type to int type and what to do about it.
sample.py
data=int("1")
print(data)
sample.py
data=int("1.0")
print(data)
sample.py
data=int(float("1.0"))
print(data)
Can be solved by.
When I got the error for the first time, I tried my best to search, but I couldn't find any information. So, I wrote this article with the intention of increasing the information as much as possible.
Recommended Posts