+ 2

what is going on in this program?

print("what is going on in this program? ") x=4 print(x<<2) x=5 print(x<<2) x=6 print(x<<2) x=4 print(x<<4) x=1 print(x<<4) https://code.sololearn.com/cdn017l94vIx/?ref=app

28th Jun 2019, 5:36 AM
Mohd Rayyan
Mohd Rayyan - avatar
2 Antworten
+ 4
https://www.sololearn.com/learn/4087/
28th Jun 2019, 6:36 AM
Diego
Diego - avatar
+ 4
<< is a binary operator : left shift. 4 << 2 = 16 because : 4 = 00100 00100 << 2 = 10000 = 16
28th Jun 2019, 6:01 AM
Théophile
Théophile - avatar