SunFounder Thales Kit for Raspberry Pi Pico, Release 1.0
A_list
=
[
"Banana"
,
255
,
False
,
3.14
]
(A_list[
-
1
])
>>> %Run -c $EDITOR_CONTENT
[3.14]
Print the second, third item:
A_list
=
[
"Banana"
,
255
,
False
,
3.14
]
(A_list[
1
:
3
])
>>> %Run -c $EDITOR_CONTENT
[255, False]
Change List Items
Change the second, third item:
A_list
=
[
"Banana"
,
255
,
False
,
3.14
]
A_list[
1
:
3
]
=
[
True
,
"Orange"
]
(A_list)
>>> %Run -c $EDITOR_CONTENT
['Banana', True, 'Orange', 3.14]
Change the second value by replacing it with two values:
A_list
=
[
"Banana"
,
255
,
False
,
3.14
]
A_list[
1
:
2
]
=
[
True
,
"Orange"
]
(A_list)
>>> %Run -c $EDITOR_CONTENT
['Banana', True, 'Orange', False, 3.14]
Add List Items
Using the append() method to add an item:
C_list
=
[
"Red"
,
"Blue"
,
"Green"
]
C_list
.
append(
"Orange"
)
(C_list)
>>> %Run -c $EDITOR_CONTENT
['Red', 'Blue', 'Green', 'Orange']
Insert an item as the second position:
C_list
=
[
"Red"
,
"Blue"
,
"Green"
]
C_list
.
insert(
1
,
"Orange"
)
(C_list)
134
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 ...