SunFounder Thales Kit for Raspberry Pi Pico, Release 1.0
Membership Operators
Membership operators are used to test if a sequence is presented in an object.
Operator
Description
in
Returns True if a sequence with the specified value is present in the object
not in
Returns True if a sequence with the specified value is not present in the object
a
=
[
"hello"
,
"welcome"
,
"Goodmorning"
]
(
"welcome"
in
a)
>>> %Run -c $EDITOR_CONTENT
True
>>>
Bitwise Operators
Bitwise operators are used to compare (binary) numbers.
Operator
Name
Description
&
AND
Sets each bit to 1 if both bits are 1
OR
Sets each bit to 1 if one of two bits is 1
^
XOR
Sets each bit to 1 if only one of two bits is 1
~
NOT
Inverts all the bits
<<
Zero fill left shift
Shift left by pushing zeros in from the right and let the leftmost bits
fall off
>>
Signed right shift
Shift right by pushing copies of the leftmost bit in from the left, and let
the rightmost bits fall off
num
=
2
(num
&
1
)
(num
|
1
)
(num
<<
1
)
>>> %Run -c $EDITOR_CONTENT
0
3
4
>>>
132
Chapter 3. For MicroPython User
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 ...