Python Forum
Nested while loop problem + turtle
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Nested while loop problem + turtle
#2
You need to reset y to 0. When x is 0 and y reaches img.size[1], the inner loop ends. Then x is incremented, and it checks the inner loop's condition again. But since you didn't reset y, it skips the loop and increments x again, until the outer loop is done. So when you increment x, reset y.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: Nested while loop problem + turtle - by ichabod801 - Jul-06-2019, 11:27 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  problem program runs in a loop jasserin 0 800 May-18-2024, 03:07 PM
Last Post: jasserin
Photo Problem installing turtle MasterJediKnight7 17 31,193 Mar-18-2024, 10:22 AM
Last Post: bmohamadyar313
  While Loop Problem Benno2805 1 1,186 Sep-06-2023, 04:51 PM
Last Post: deanhystad
  Big O runtime nested for loop and append yarinsh 4 2,847 Dec-31-2022, 11:50 PM
Last Post: stevendaprano
  Nested for loops - help with iterating a variable outside of the main loop dm222 4 2,881 Aug-17-2022, 10:17 PM
Last Post: deanhystad
  Loop reading csv file problem faustineaiden 1 2,144 Dec-11-2021, 08:40 AM
Last Post: ibreeden
  Problem with nested JSON Kalet 7 4,119 Dec-09-2021, 11:13 PM
Last Post: Gribouillis
  How do I add another loop to my nested loop greenpine 11 6,720 Jan-12-2021, 04:41 PM
Last Post: greenpine
  Error on nested loop : Invalid syntax dvazquezgu 3 4,313 Nov-25-2020, 10:04 AM
Last Post: palladium
  Infinite loop problem Zirconyl 5 4,172 Nov-16-2020, 09:06 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020