+ 1

Find the output.

Why the answer to question : print(int('0011', 2)) Is 3?

9th Oct 2019, 5:26 PM
Neha Gupta
Neha Gupta - avatar
3 Réponses
+ 4
Mirielle ,yes i checked : int() function in Python and Python3 converts a number in given base to decimal. Syntax : int(string, base) Hence, string with 0011 of base 2 (binary) got evaluated as 3 in decimal (int). 🌼
9th Oct 2019, 6:06 PM
Neha Gupta
Neha Gupta - avatar