Int()'s Second Parameter


#1



https://www.codecademy.com/en/courses/python-intermediate-en-KE1UJ/0/5?curriculum_id=4f89dab3d788890003000096#

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)


#2

write this code instead :slight_smile:

print int("11001001", 2)


#3

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