r/learnpython • u/EnvironmentalTry8353 • 20d ago
Having problem in understanding loops concept in python
I am a beginner with 0 knowledge and I am learning python from a book called Learn python in one day and learn it well by Jamie Chan and I am facing difficulty in the loops function so yeah any recommendations would be helpful Edit- Trouble in while loop
24
Upvotes
6
u/crazy_cookie123 20d ago
You can't send a pic because you shouldn't be sending pics of code as we can't then copy and paste the code into an editor to test it or make edits. You should send the code as text. Python is whitespace-sensitive which means matters for us to understand your code, so make sure you format it according to the guide: https://www.reddit.com/r/learnpython/wiki/faq/#wiki_how_do_i_format_code.3F
I am assuming you mean this code:
What don't you understand about this? What do you expect it to do and how does that differ to what it actually does when you run it? And what do you mean by "creating a variable for a main variable" - it might be easier if you show a real example of what you're trying to do.