int(str, 2) code example Example: convert string to int python my_string = "50485" print(int(my_string))