Python has an
int() function that you’ve seen a bit of already. It can turn non-integer input into an integer, like this:
int("42") # ==> 42
What you might not know is that the
int function actually has an optional second parameter.
int("110", 2) # ==> 6
When given a string containing a number and the base that number is in, the function will return the value of that number converted to base ten.
In the console are several different ways that you can use the
int function’s second parameter.On line 7, use