While I loop and loop
If condition is met, break
Modulo gives rest
I was just learning about the while loop in Python, and I found out that it’s really useful for repeating a block of code as long as a certain condition is true. I also learned about the if statement, which allows me to execute a block of code only if a certain condition is met. The modulo operator (%) also came up, and I discovered that it gives me the remainder of a division operation. This is really handy for checking if a number is even or odd. Lastly, I learned about the break statement, which allows me to exit a loop prematurely if a certain condition is met. It’s a great way to stop a loop from running indefinitely.
ANSWER: 1 2https://t.co/Qmwbs4xfqv https://t.co/hAIkoTEDho pic.twitter.com/1VtpDTHjCp
— Walker Spearson (@SpearsonWa83643) March 18, 2024