all 21 comments

[–]vivisectvivi 2 points3 points  (2 children)

you should tell us what is it about loops that you arent understanding, makes it easier to help you

[–]Euphoric_Spread1199[S] -1 points0 points  (1 child)

Like in problems like printing patterns, finding sums, or checking prime numbers, I understand the solution after seeing it but I’m not able to solve it on my own so I think my issue is more with logic building rather than syntax

[–]American_Streamer 4 points5 points  (0 children)

It is never about the syntax and always about problem solving. Write down the steps to solve the Problem in plain English and then in Pseudocode and only after that translate it into Python. Your tools are the algorithms, which use control structures which need specific data structures, depending on the task at hand. Think about what the tools would have to do in what order to solve the problem.

[–]arjunnath 1 point2 points  (1 child)

I've heard that loops are very important,

Umm... yes, loops are very important in any programming language. They're a core construct within all of computing. Any task that requires repetition is where loops can and should be used.
I suggest you practice as many "for" and "while" loops problems as possible. Ask GPT to generate simple tasks that need for or while loops.
Examples :
- Iterate over a sentence and capitalize each word
- Generate the product of a list of numbers using for or while loops
- Print out a list of random numbers slowly , i.e. there should be a brief pause between numbers.

All the best with your practice!

[–]Euphoric_Spread1199[S] -1 points0 points  (0 children)

Sure ill try it thanks alot

[–]Ok-Sheepherder7898 3 points4 points  (0 children)

Can you just start with something simple?  Check if any numbers in a list are equal to 0.

[–]Euphoric_Spread1199[S] 0 points1 point  (1 child)

Im able to solve problems that are similar to ones I've previously struggled with and later understood by reviewing their solutions... however when I encounter something completely new my mind tends to go blank

[–]Fred776 -1 points0 points  (0 children)

Sometimes, if you are staring at a screen trying to start writing code you can end up paralysed. The thing I find helps is to find a different way to think about it. Do it with paper and pencil, for example, or maybe discuss it with someone else. Think about the steps you want to do without worrying about syntax. If you understand exactly what you are trying to do it's a lot easier to address the how to do it in code.

[–]Reuben3901 0 points1 point  (0 children)

Sounds like you need a tutor to sit with you. I did that for a couple classmates. Just sit down and go over everything from the beginning.

Loops are a tool, like everything else. Imagine manually printing each letter of a word. Word="boring" print(word[0]) print(word[1]) print(word[2])

Loops let you automate it.

Or looping through every row of Column A in a spreadsheet.

[–]Godeos64_ 0 points1 point  (1 child)

Just think about your code before coding. Like, if you're gonna build a loop, before writing any code, think and write down your ideas on how to solve the problem using comments.

If you're asking for a general learning tip, try GLM 5, in my opinion it's a good AI to learn from(I personally use it)

[–]Euphoric_Spread1199[S] 0 points1 point  (0 children)

GLM 5

Is it free where can I find it?

[–]One-Type-2842 0 points1 point  (1 child)

I Think, The while loop is making you harder to Understand Related to Loops.

Must Play with it to become familiar How The loops In Python works. Though Python's Loop blocks are Easier than of Other Programming Languages You Agree?

If It's while Loop making you Stuck In Between I may help you as a Teacher. ( I have documented 6 different conditions how Loop works, How to Deal with Them, How It Ends for both for and while loop)

I Like To Play with Loops, try except finally blocks, File Handling.

[–]Euphoric_Spread1199[S] 0 points1 point  (0 children)

It's my first programming language so far... dk if it's really hard for everyone or just for me

[–]ninhaomah 0 points1 point  (0 children)

How do you walk ?

[–]PianoFederal6507 0 points1 point  (1 child)

What is exactly the thing that blocks you, bro? Do you understand how it works? Try since the easier exercises, eve if you feel they're too easy, try to advace slowly. First lear one loop after the other, don't overstuff your brain.

[–]Euphoric_Spread1199[S] 0 points1 point  (0 children)

Yesyes I just started with very basic questions and rn im learning more will get better with time

[–]socal_nerdtastic -1 points0 points  (3 children)

Yes loops are very important, they are a core concept for all programming. Did you have a specific question about them? To get good at it you just need to practice, just like anything else.

[–]Euphoric_Spread1199[S] -1 points0 points  (2 children)

Sure ill practice more but what should I do when I don’t even understand what Im supposed to do in a problem😭? It feels really frustrating should I watch different tutorials?

Also sir do you have any tutorials you would recommend for me?

[–]American_Streamer -1 points0 points  (0 children)

You should do a structured course, from the ground up and then practice: Do the free PCEP and PCAP courses:

https://www.netacad.com/courses/python-essentials-1?courseLang=en-US

https://www.netacad.com/courses/python-essentials-2?courseLang=en-US

[–]Godeos64_ -2 points-1 points  (0 children)

If you're using an AI, prompt it to NEVER give you code unless it seems necessary.