+ 1

Can anyone explain this?

Why the answer is 3 Print(int("0011",2)

20th May 2020, 12:51 AM
Bruklin
Bruklin - avatar
5 Antworten
+ 3
0011 = 3 binary 0011 is 3 in decimal. int() is given a second argument 2 to specify the binary base.
20th May 2020, 1:06 AM
Bahhaⵣ
Bahhaⵣ - avatar
+ 1
Thanks for the comments everyone: This question was asked to me in yesterday's challenge
20th May 2020, 8:04 AM
Bruklin
Bruklin - avatar
0
Bruklin Bahha🐧 It will return Syntax Error
20th May 2020, 3:13 AM
Prince Kumar
Prince Kumar - avatar
0
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 of course with a missing parentheses and capital p in "Print" , it will not work. but you get the purpose of the question nevertheless.
20th May 2020, 3:35 AM
Bahhaⵣ
Bahhaⵣ - avatar
0
Bahha🐧 Yeah I know
20th May 2020, 3:37 AM
Prince Kumar
Prince Kumar - avatar