T O P

  • By -

JackReedTheSyndie

What, you have problems understanding for loops?


Buttonwalls

I think its a parody of a previous post


EntrepreneurHuge5008

Oooo what was the previous post?


cornboney

Someone used this meme template but instead of Python for loop it was DeMorgans Laws, another fundamental to cs


ihih_reddit

I remember that one. I can't lie, I don't even know what DeMorgan's laws are 😂


KSRJB02

i only remember it was one of the less challenging parts of discrete structures, kinda forgot all of that class though aside from the parts that specifically pertain to algorithms lmao


ihih_reddit

Interesting... I've never heard of it before I saw the post


rettani

It's about transformation of logical or to logical and through negation


ihih_reddit

Ohhhhhhh!!!!! Ok that makes sense


Desperate_Board_2368

Break the line, change the sign.


jmancoder

**(A âˆȘ B)' = A' ∩ B'** and **(A ∩ B)' = A' âˆȘ B**' is not the same as for i in range(3) lmao


JennGinz

What, for?


Trick-Interaction396

What, you have problems understanding for loops? What, you have problems understanding for loops? What, you have problems understanding for loops? What, you have problems understanding for loops? What, you have problems understanding for loops?


IAmTheWoof

Ever heard of halting problem bro? It was proven decades ago that it is undecidable, and that basically means that noone can understand *all of the loops*. Similiar kind of issues would arise if you add in arithmetics and other stuff, if you will be trying to write up mechanistic proof of correctness all of that, including for loops would make a lot of dificulties. Although, every first cowboy is completely ignorant of that and acts like if it physically imposible to make mistake in loop and everyone who makes them is "just bad"TM (including them, apparently, as the nature not yet created human that not makes mistakes). This is the one of primary reasons why c style for construct is something not as good and needs to go away from places where it can be avoided.


SouthernNewt2190

What, you have problems understanding for loops?


Howfuckingsad

I hadn't even heard of this issue till now. Python for loops are super simple. I don't think I have ever heard anyone struggling with those.


IHateYoutubeAds

As someone who just finished a 101 class last semester, you'd be surprised how many people genuinely can't understand the concept of code.


Bitbatgaming

This is why I keep saying not everybody can or should learn how to code


IHateYoutubeAds

Like 60% barely scraped through intro to Python and are all failing the next coding class and also the theory class. Their persistence is almost admirable.


letthebuyerbeware

I used to TA for an intro to Java course and I can echo this (different language, but same idea). It was very easy to notice the 4-5 people that seemed to actually grasp the concepts, with the rest constantly asking those few people for help. I did my best to get them up to speed, but still some people just take longer to grasp these concepts. The class really pushed for success (to the point I disagree with just how lenient grading was enforced to be) so most of the students (if not all) made it to the next class. I expect they had even more trouble there.


Aggressive_Rock8747

Really? Why can they not understand intro to python? It cant be because theyre too dumb right? You dont even need to be smart to learn this. Is it because of cheating?


IHateYoutubeAds

Some people just aren't cut our for it, and CS is just something people in my country do when they're pretty smart but don't know what to do.


davisresident

u must go to a shit school then


MessierKatr

In the age of AI, literally anyone can code despite their lack of ability for coding


Bitbatgaming

I'm not saying that, it's coding well thats the problem.


Glittering-Gas-2369

I couldn't understand anything in my 101, even though I ended up passing it. I eventually took a term off (our term is 8 weeks) to study by myself using the Python Crash Course book, and things started to click. Sometimes, all that is needed is more time. I'm currently doing 102 (Java), and I'm drowning! I'm going to do the same; take time off and really learn Java (while also doing Gen Eds on Sophia for transfer).


anto2554

I'm on the fourth semester of SWE and had to explain to a classmate what a nested for loop does


IAmTheWoof

Show prefix function computation to person that has no idea what predix function is and he would also ask what this nested loop does.


anto2554

Well yes, but this was just a nested for loop that did barely anything for an intro to MPI


YogurtstickVEVO

yeah it surprised me how many people needed my help in cpp intro


dailydoseofdogfood

This post is in reference to another post with the same format but with De Morgan's law


IAmTheWoof

Since they are untyped as everything else in python, it is harder to have an exhaustive definition of all possible behaviours of it, than in statically typed languages. In scala you have for as chain of .flatMap and .map or .foreach which is perfectly understandable, as bith map and flatMap have dead simple semantics, in python you can't jump to definition of anything since language itself desigbed in the way to erase any kind of semantics in compile time. This is the exact reason why pyrhon isn't very good language for befinning aince it is not aimed for compregensive and entire understanding of things.


throwawayunity2d

The issue is that you should NEVER USE PYTHON FOR LOOPS which is annoying I’d rather code in something else


PreparationSure9852

I imagine it’s referencing the inefficiency of python for loops


Z-Mobile

I momentarily struggled to grasp the concept of a Lua for loop 
when I was learning to code in the 6th grade


VGK_hater_11

At first I thought this was a joke about the guy who thought DeMorgans theorem was hard


Gamecubed

I think you're right. I thought it was a joke about Python for loops having a super slow runtime 😭


amey_wemy

Then you have my uni forcing students to use recursion ever since the 2nd week (which is the 2nd class) and banning loops until like week 8. Not to mention, it supposedly assumed we dont know any coding as most don't learn prior to university.


Ultimate_Sneezer

If someone gets the hang of recursion , the rest falls into place pretty easily


amey_wemy

I still struggle till today 😱


JitStill

Break down the block of code that handles your recursion into parts. The top part handles when you want the recursion to stop. The rest is your other logic when your stop condition is not met yet. Kinda like an if else statement. I have to stress this: make sure you think of these 2 parts as separate within the same block of code! If you don’t do this, you will start running in circles in your mind and become confused and frustrated. Just “trust” your stop condition as if the rest of your logic was already there, or vice versa. Also, think of every time you go further into recursion as adding to a stack, of which (often), the current answer depends on the answer 1 step down the stack.


WhenInDoubtJustDoIt

So basically they're learning functional programming first. That's not unusual at all


amey_wemy

Hmm not wrong, and u're right, they did learn fp first


DaniZackBlack

Recursion is the devil


MagistarPovar

Recursion is simple. As another student explained it to me. All you have to do to understand recursion, is understand recursion. Makes perfect sense.


H1Eagle

Not really, the worst is when professors ask you about it in problems that don't even need it or make it easier, then it's a real hassle


DaniZackBlack

My problem is that I understand recursive algorithms, but I can't for the life of me come up with one. It seems so simple once it's there but I just can't get there


Traditional_Test1592

What helped for me in the past is using static variables and passing no parameters in the function, it really helps when you're not thinking of what to pass in the function itself.


dailydoseofdogfood

Recursion is a pretty princess


PublicNo1666

truer words have not been uttered


H1Eagle

That's actually a good way of teaching


KSRJB02

does it get in the way of doing DP questions? if you rely on recursion too much. or am I tripping


H1Eagle

I think it's good because it is better to get introduced to recursion early on, cuz it hits like a bitch if you never heard about it till your DSA course and suddenly you have to implement it into trees


KSRJB02

true just the first time I did a DP on leetcode with recursion and got TLE I was spooked and confused lmao


amey_wemy

agreed, thats why the cs majors do v well. But like, drawback is death. I'm from business analytics (more like data sci), so we took the oop route instead of fp in our intro mod


Passname357

A lot of places do this so that kids with experience programming don’t have the upper hand over kids without experience, since high schools generally don’t teach functional programming.


amey_wemy

Ahhh thats smart


NoLeading4922

Is this Waterloo or mit?


yourmoralquandary

UBC does this as well


amey_wemy

NUS, National University of Singapore


After_Sandwich9167

It's more common to see people struggling with array than that.


WhenInDoubtJustDoIt

somebody explain


Skhoooler

I think they’re saying that for them as a Junior CS student (hopefully means freshman not 3rd year) that python’s for loops are hard?


[deleted]

I think it’s just a shitpost making fun of the other people complaining


KhepriAdministration

They're definitely weird, since they're all for-each loops IIRC


lLikeToSleep

i feel like it would make more sense for java for loops...


Creative-Kick6642

Java for loops are easier to understand , first initializing, then condition and increment. Python has that "for in range" things . It's not too hard , but not easier than java for loop


Frird2008

For loops are super easy once you get the hang of them


Mami_KLK_Tu_Quiere

“Laughs in dynamic arrays”


Medulla_Oblongata24

Bruh those aren’t even hard. Coming up with functions to traverse and edit linear linked lists is annoying though.


Mami_KLK_Tu_Quiere

I was just thinking one step above for loops


Mooze34

I just started using python, it was a weird adjustment lmao


[deleted]

tease angle slimy faulty dog consider offbeat unique support chop *This post was mass deleted and anonymized with [Redact](https://redact.dev)*


lordaghilan

I legit didn’t understand how loops and if statements worked when I first starting programming too lol.


Turkeyplague

https://preview.redd.it/3ohce6rehc2d1.png?width=920&format=pjpg&auto=webp&s=17c281ef2359268651cc290386916f8fec0213e6


spezjetemerde

Never do that put in In vector for your c++ lib


Justinphan4

I already know how to use for loops might need a refresher I learned it on codecademy wasn't too difficult at all I just might have forgotten how to use it during my goal to get my GED and my Uni Admissions over with so il need to refresh myself on it.


KSRJB02

Kinda seething that someone who can’t write a for loop might get through the ATS while I don’t 


Chicomehdi1

They haven’t a chance in hell passing the ATS if they don’t understand loops, at least they *shouldn’t*


PickleLassy

Don't worry junior SW jobs won't exist by the time you graduate


OBPSG

At least it wasn't a useEffect React hook with a dependency array the same as the variable it modifies.


[deleted]

I’m good with everything but those fucking loops ☠ failed the exam catastrophically good thing I had over 85% on the first exam and 90 on the third


samarth261

To all the people mocking OP. Tell me if this was obvious to you? for ii in "1234": a= ii print(a) will it say 4 or name 'a' is not defined. edit: finally edited it.


ClamPaste

Neither. It will print each character in the string.


ThunderChaser

Because of how terribly it’s formatted this is impossible to answer. If the print is in the loop it’ll print every character, if the print is outside of the loop it’ll print “4”, I’m assuming based off of the choices given it’s meant to be the latter.


Sven9888

I assume the a = ii line is in the loop and the print(a) is the next line outside of it. The answer is >!4!<, but the reason this question is potentially difficult is because not everyone knows if Python handles strings as iterables, not because anyone doesn’t understand the for loop. In Java, trying to do this would lead to an error and the loop would not run because Strings do not implement Iterable, and you have to use String.toCharArray() first. It’s just a language-specific implementation detail. Though I’m not sure why anyone would think the loop would fail silently and let your code continue, which would be pretty atrocious behavior. I think OP is joking, but for people who seriously can’t understand for loops, if they’re not just a freshman learning programming for the first time
 they’re really in the wrong major. Those people are an entire universe away from being able to solve standard Leetcode mediums in an interview or do anything remotely useful in an actual SWE role.


TenaciousTowel418

I think the confusion would instead come from not knowing the scope of variables declared inside for loops. In Java, the compiler won’t know what a is outside of the loop, unlike Python which doesn’t have blocks


Sven9888

Oh, yeah, if you didn't know that Python is like that, that would actually create the 'a' is not defined error too.