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
Summary of Contents for Thales Kit
Page 1: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 Jimmy SunFounder Jun 04 2021 ...
Page 2: ......
Page 4: ...ii ...
Page 6: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 2 CONTENTS ...
Page 140: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 136 Chapter 3 For MicroPython User ...
Page 164: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 160 Chapter 4 For Arduino User ...