SunFounder Thales Kit for Raspberry Pi Pico, Release 1.0
Logical Operators
Logical operators are used to combine conditional statements.
Operator
Description
and
Returns True if both statements are true
or
Returns True if one of the statements is true
not
Reverse the result, returns False if the result is true
a
=
6
(a
>
2
and
a
<
8
)
>>> %Run -c $EDITOR_CONTENT
True
>>>
Identity Operators
Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with
the same memory location.
Operator
Description
is
Returns True if both variables are the same object
is not
Returns True if both variables are not the same object
a
=
[
"hello"
,
"welcome"
]
b
=
[
"hello"
,
"welcome"
]
c
=
a
(a
is
c)
# returns True because z is the same object as x
(a
is
b)
# returns False because x is not the same object as y, even if they have the same
˓
→
content
(a
==
b)
# returns True because x is equal to y
>>> %Run -c $EDITOR_CONTENT
True
False
True
>>>
3.5. MicroPython Basic Syntax
131
Содержание 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 ...