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: ...
I have while j < n in the first while loop and also in the inner loop. I could not see a way to simplify the two while j < n statements. It seems that both need to exist. Is it common for such sliding window questions? Is there any good way to simplify based on the current code?
Sep 19, 2022 ... Can any one help me understand how to write this code? I am using ... Here's an example that may help you understand how to use a while ...
Jun 9, 2022 ... Regexes are an extremely compact, terse, somewhat cryptic mini-programming language specifically for matching strings. Untested: import re while ...
Jan 28, 2023 ... You don't import time , though I suspect that you didn't copy the code exactly as you've been running it (there's a stray < there too).
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 ...
Dec 21, 2022 ... The while loop does not effect code outside the loop except that changes to variables and data inside the loop will be seen outside the loop ...
Sep 23, 2023 ... answer = input ("Stranger: Can you provide us your information ?(Y/N): ") .upper() · while True : · if answer == “Y” : · break · if answer == “N”: