Int()'s Second Parameter


Error - "Traceback (most recent call last):
File "python", line 7, in
ValueError: invalid literal for int() with base 10: '0b11001001'"

and when 0b is not added

Oops, try again. It looks like you didn't print out the base 10 equivalent of 11001001.

Here is my code -

print int("0b11001001", 10)


write this code instead :slight_smile:

print int("11001001", 2)


This can also be an answer print int("201",10)
Want more short? print int("201")