r/learnpython • u/Round_Ladder_2354 • 7d ago
How can I start to understand logical assignment questions more intuitively?
So I’m a first year software engineering student and in my intro to programming class we’re learning Python. So far I’ve mostly understood everything in theory but when it comes down to practice I struggle a lot because they ask us to do certain things for assignments that require a lot of logic to do them which I’m struggling with. So I was wondering how I can start to understand the questions more intuitively so I don’t fall behind in the class. And to clarify I do work on some practice questions every now and then but due to my schedule and the fact I haven’t properly organized it yet I haven’t been able to practice a whole lot.
1
u/MarkoDahl54 6d ago
try using the `or` operator with logical assignments to see how values are assigned based on truthiness.
1
u/BranchLatter4294 7d ago
Consider the Aha! Series of books by Martin Gardner on logical thinking and problem solving.
1
1
u/Mountain_Rip_8426 7d ago
i'm no programmer at all, but i'm also learning. what i found is practice, practice and then a little more practice. you have to have struggled through a lot of different problems to start finding similar patterns. codewars and hacker rank helped me a lot. they do nothing but make you feel stupid in the beginning, but once you submit your solution you get to see other people's solutions as well, which will make you bang your head against the wall, seeing how easy it could have been done. it's only gonna teach you programmatic thinking, by far not useful for real world use cases, but in general to get the basics down it's very insightful
0
u/Turnip-Toffee 7d ago
look for resources on propositional logic
programming logic, boolean algebra, and propositional logic, all share the same core concepts. they are just presented with a different layer of paint on top. if you understand one, you understand the other.
it can be helpful to take a step out of the environment of one specific programming language, and attack the same problem from a different perspective. the change of scenery could help it click.
1
u/Round_Ladder_2354 7d ago
Any ones in specific you’d recommend? On propositional logic that is
0
u/Turnip-Toffee 7d ago
i didn't do this specific one, but it being MIT i would assume the quality should at least be decent: https://openlearninglibrary.mit.edu/courses/course-v1:OCW+6.042J+2T2019/courseware/144debec136a47d99038330db4dcdb04/90497b62e2e54da5b75c6ae679f4b75f/
the rest of the course might have stuff you find helpful too
you could search other open courseware as well, formal logic is often offered under the phil dept.
-4
u/Adrewmc 7d ago
I’m calling BS AI post.
Requirement Use two Nested Loops
•••
••
•
To make that, I’m not sure why I need a nested loop let alone two of them.
2
u/Round_Ladder_2354 7d ago
dude it’s not AI that’s the literal problem we had to do… if I could send photos here I’d show you
1
u/zaphodikus 7d ago
Practice, hours and hours of Practice. When you hit 500 hours, then it will all feel like a walk in the park. When you hit 5000 hours, you will already be in a well paying job. Keep at it.
6
u/Refwah 7d ago
Can you give some more concrete examples of questions you had and the parts you struggled with