why can't IT management majors into for loops?
>>56479824v={}
v["two0"]=1
for i in range(1,30):
v["two"+str(i)]=v["two"+str(i-1)]*2
print("2 to the 20th power = ",v["two20"])
You can't name variables by evaluating.
>>56479824
>recommends using for loop instead of just 2^20. goddam kys already
>>56479997
pow() are for casual faggots.
>>56479824
Loops and other flow control directives introduce additional complexity into the application source code. To avoid hiring expensive, experienced developers it is always preferable to program in the most basic way possible.
>>56479997
2nd
>>56479997def power(x,y):
z=x
for i in range(0,y):
z*=x
return x2**10pow(2,10)import math
math.pow(2,10)
Pick one.
Idk is it faster to do a lookup or binary shift for power of 2? You'd have to go to memory (slow) instead of reg right?
Not a computer guy so idk.
>>56480184
>>56480160
Forgot1<<10.
>>56480184
How would binary shift work? It will just skip to the next power of two plus the value of the ones in the original number.
>>56479824
>manager pushes a problem on to me
>it's this, this is what's wrong
>'No, you're wrong, it can't be that'
>it is that
>EVERY
>TIME
Fuck this.
>>56480184
binary right shift just adds a multiple of 2 to your number. in the same way adding a 1 to the left of 100 is adding a thousand.
>>56480269
welcome to work. you have to learn to defend your claims and decisions.
>>56480184
any modern compiler will optimize multiplication by two into a left shift of one
>>56479978two0=1
for i in range(1,30):
exec("two"+str(i)+"="+str(eval("two"+str(i-1))*2))
print("2 to the 20th power =",two20)
Oh wait you can.
a = {a:2}
a = {a:a*2}
>>56480552
>multiplying an object
>>56480581
but everything is an object
>>56479824
They just don't give a fuck. Like a baws.
What is even "IT management"?
>>56479997
2 xor 20
nice
>>56480638
Just like myself.
>>56480653
That's what I thought.
>>56480638
Not ideas, ``anonymous''.
Related
>>56480160
or just1048576
Math.pow(2, 20);