What is the output of print(int('1010', 2)) in Python?
print(int('1010', 2))
Correct answer
B. 10
5 views
B. 10
5 views
int('1010', 2) converts a binary string to its decimal value 10.
Asked in: Python Interview Data Types
https://docs.python.org/3/library/stdtypes.htmlNot sure why the answer is B? Ask here and get an explanation.