Mar-11-2019, 12:39 PM
Hello,
I am a beginner student and this is pretty basic, but I am stumped. Our text is Python for Dummies and I am having a hard time figuring this loop out. We jumped from doing pseudocode and flowcharts and basic problem to this loop. The loop is this:
a = number of loops (starting with 0 but increasing by 1 each iteration)
b = a + 1
c = a + b
Condition if c < 5 then loop will continue, else, it will end
So I defined a = 0 but realized that just gives me the variable. Then I defined a and gave it a range of 0, 5. But wasn't sure how to get that range to run automatically. Part of my problem is on the Python tutorials I am confused by the way they do loop examples. I'm basically totally confused. I would appreciate any clarification.
I am a beginner student and this is pretty basic, but I am stumped. Our text is Python for Dummies and I am having a hard time figuring this loop out. We jumped from doing pseudocode and flowcharts and basic problem to this loop. The loop is this:
a = number of loops (starting with 0 but increasing by 1 each iteration)
b = a + 1
c = a + b
Condition if c < 5 then loop will continue, else, it will end
So I defined a = 0 but realized that just gives me the variable. Then I defined a and gave it a range of 0, 5. But wasn't sure how to get that range to run automatically. Part of my problem is on the Python tutorials I am confused by the way they do loop examples. I'm basically totally confused. I would appreciate any clarification.