SunFounder Thales Kit for Raspberry Pi Pico, Release 1.0
if. . . else
if
test expression:
Body of
if
else
:
Body of
else
The
if..else
statement evaluates
test expression
and will execute the body of
if
only when the test condition is
True
.
If the condition is
False
, the body of
else
is executed. Indentation is used to separate the blocks.
if. . . else Statement Flowchart
Example
num
= -
8
if
num
>
0
:
(num,
"is a positive number."
)
else
:
(num,
"is a negative number."
)
>>> %Run -c $EDITOR_CONTENT
-8 is a negative number.
114
Chapter 3. For MicroPython User
Содержание Thales Kit
Страница 1: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 Jimmy SunFounder Jun 04 2021 ...
Страница 2: ......
Страница 4: ...ii ...
Страница 6: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 2 CONTENTS ...
Страница 10: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 6 Chapter 1 Introduction to Raspberry Pi Pico ...
Страница 12: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 8 Chapter 2 What is Included in This Kit ...
Страница 13: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 2 1 Components List 2 1 Components List 9 ...
Страница 42: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 38 Chapter 2 What is Included in This Kit ...
Страница 140: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 136 Chapter 3 For MicroPython User ...
Страница 164: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 160 Chapter 4 For Arduino User ...