Post

Python Developer
Python Developer@Python_Dv·
🤔🚀 Comment your answers below! 👇
Python Developer tweet media
English
21
9
148
21.4K
Sergei Kotov
Sergei Kotov@kotov_dev·
@Python_Dv Answer: B) 3 int(string, base) converts from that base: › int('11', 2) reads '11' as binary › Binary '11' = decimal 3 How: 1 * 2 ^ 1 + 1 * 2 ^ 0 = 2+1 = 3 For beginners — second parameter is the base: › int('11',10)=11 › int('11',2)=3 › int('A',16)=10
English
0
0
14
1.4K
Kamal Gurjar
Kamal Gurjar@KamalGurjar8·
@Python_Dv output: B) 3 The second arg is the base. int('11', 2) = binary 11 = decimal 3.
English
0
0
5
2.5K
Jay
Jay@learnaiwthme·
@Python_Dv Answer: B) 3 Explanation, short and clear: int('11', 2) reads '11' as a binary number. Binary 11 equals 3 in decimal.
English
0
0
2
1.4K
Himal
Himal@himalbhattaraix·
@Python_Dv B) 3 int('11', 2) converts the binary number 11 to decimal
English
0
0
1
534
Droid | Code
Droid | Code@DriodXL·
@Python_Dv Binary Ah. The Answer is 3. You are reversing the binary '11' to a normal number. Eg convert 3 to binary, using 8421(1st four binary digits) To get 3 from 8421, 2+1=3 (11) Can 3 be gotten from 8,4? No,(00) In binary it will be (0011), which is 2,1, add it you get 3.
English
0
0
1
913
Tanmay Newatia
Tanmay Newatia@thetanmaydoes·
@Python_Dv this was new, the second argument is for base: hence base 2, makes it binary. and "11" in binary is 3 in integar. banger!
English
0
0
4
914
Paylaş