[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

why can't IT management majors into for loops?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 24
Thread images: 3

File: 7cqs2pj135kx.png (113KB, 886x806px) Image search: [Google]
7cqs2pj135kx.png
113KB, 886x806px
why can't IT management majors into for loops?
>>
>>56479824
v={}
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
>>
>>56479997
def power(x,y):
z=x
for i in range(0,y):
z*=x
return x


2**10


pow(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
Forgot
1<<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
>>
>>56479978
two0=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.
>>
File: has_u_red_it.jpg (3MB, 2448x3264px) Image search: [Google]
has_u_red_it.jpg
3MB, 2448x3264px
>>56480638
Not ideas, ``anonymous''.
>>
File: 1464061117244.png (311KB, 652x669px) Image search: [Google]
1464061117244.png
311KB, 652x669px
Related
>>
>>56480160
or just

1048576
>>
Math.pow(2, 20);
Thread posts: 24
Thread images: 3


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.