Need help understanding this while loop - Python discussion
Feb 13, 2024 ... I'm new to while loops, and I don't quite get what's going on in this code from my book: current_number = 1 while current_number <= 5: ...
Feb 13, 2024 ... I'm new to while loops, and I don't quite get what's going on in this code from my book: current_number = 1 while current_number <= 5: ...
while (True): row = file.readline() if row == "" #here the variable row is recognised. Interestingly here is also "" which to me means that Python sees that part as str, no?
Jun 4, 2026 ... That said, a while loop is concept related to control flow, they're not a python exclusive feature and basically any programming language uses ...
Discussions on Python.org. Newbie question - Programming help.It’s quite easily translatable into Python: while (answer := input("Are you ready to play: ").lower()) not in ('yes', 'no'): print(f"Expected 'yes' or 'no' but you entered {answer!r}").
Nov 3, 2023 ... = does not mean equality as it does in mathematics. To set counter to 0 you have this line of code: counter = 0. Inside the loop the value of ...
I need help understanding while loops. I know this should be basic knowledge, but I can’t get a clear picture of the while loop with code outside of the loop. In my case I have to have something done once every 24 hours.
Jun 9, 2022 ... This code has a some string swapping but otherwise is simple and very readable. But it also has some deficiencies: What if the user enters ...
Hey Quercus. Thanks for the quick response. I’m still newer to python, but trying to get the hang of it. Since the last line in my text doc is an empty string, I expected that that would trigger the end of the while loop (since the condition would be met). Is this incorrect?
I used command ‘ping’ for subprocess.call This time I need to check account of User to check if it’s active. Command that I run is: net user /domain USER It works fine from command line but failed in a script. Could someone help me with it?
Sep 18, 2025 ... Kartik: Does the execution engine cursor go back to the closest loop as it is done with executing the block of code.
Feb 12, 2024 ... I'm new to while loops, and I don't quite get what's going on in this code from my book: current_number = 1 while current_number <= 5: ...