You are viewing a single comment's thread. Return to all comments →
The .strip()-part isn't actually necessary, as int() uses it internally anyway. But back when I wrote the code I didn't know that. :p
.strip()
int()
It's basically one of the methods defined by the str-type; it removes all whitespace characters from the beginning and end of a string.
str
Example:
my_string = " Hello " my_string.strip() == "Hello"
Seems like cookies are disabled on this browser, please enable them to open this website
Python If-Else
You are viewing a single comment's thread. Return to all comments →
The
.strip()
-part isn't actually necessary, asint()
uses it internally anyway. But back when I wrote the code I didn't know that. :pIt's basically one of the methods defined by the
str
-type; it removes all whitespace characters from the beginning and end of a string.Example: