EasyManuals Logo

SunFounder ESP32 User Manual

Default Icon
771 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #310 background imageLoading...
Page #310 background image
SunFounder ESP32 Starter Kit
num = 2
print(num & 1)
print(num | 1)
print(num << 1)
>>> %Run -c $EDITOR_CONTENT
0
3
4
>>>
3.6.11 Lists
Lists are used to store multiple items in a single variable, and are created using square brackets:
B_list = ["Blossom", "Bubbles","Buttercup"]
print(B_list)
List items are changeable, ordered, and allow duplicate values. The list items are indexed, with the first item having
index [0], the second item having index [1], and so on.
C_list = ["Red", "Blue", "Green", "Blue"]
print(C_list) # duplicate
print(C_list[0])
print(C_list[1]) # ordered
C_list[2] = "Purple" # changeable
print(C_list)
>>> %Run -c $EDITOR_CONTENT
['Red', 'Blue', 'Green', 'Blue']
Red
Blue
['Red', 'Blue', 'Purple', 'Blue']
A list can contain different data types:
A_list = ["Banana", 255, False, 3.14]
print(A_list)
>>> %Run -c $EDITOR_CONTENT
['Banana', 255, False, 3.14]
304 Chapter 3. For MicroPython User

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the SunFounder ESP32 and is the answer not in the manual?

SunFounder ESP32 Specifications

General IconGeneral
BrandSunFounder
ModelESP32
CategoryController
LanguageEnglish