EasyManua.ls Logo

SunFounder ESP32 - Page 294

Default Icon
771 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
SunFounder ESP32 Starter Kit
x = 10
while x > 0:
print(x)
x -= 1
>>> %Run -c $EDITOR_CONTENT
10
9
8
7
6
5
4
3
2
1
Break Statement
With the break statement we can stop the loop even if the while condition is true:
x = 10
while x > 0:
print(x)
if x == 6:
(continues on next page)
288 Chapter 3. For MicroPython User

Table of Contents