While loop
Why would there be loops like this statement?
To give a simple example: we want to calculate the number of even numbers within 0-100, and this time we need to loop this statement
Then one might say, "What 0+2+4+.......+98 can be calculated?"
Suddenly our condition changed: Calculate the number of even numbers within 0-10000000 and
It can be imagined that this is how a workload, the cycle is just to solve this problem.
Figure:
The representation of a while loop in Python is like.
Grammatical form:
while Loop condition: Loop body (code block) loop Body (code block) Loop Body (code block) ...
eg
# calculates an even number of 100 and count= = 0 # Total while Count <: If count%2==0: # to determine if an even sum+=count # is an even number added count+=1 # Count plus one
Python full stack development: Python loop statement while