Memorize Python commentary 5 --Lists

# A list stores values inside of the array. friends = ["Kevin", "Karen", "Jim"]

# How can we access individual elements print(friends)

# Refer to elements by their index. print(friends[0]) print(friends[-1]) print(friends[1:])

friends = ["Kevin", "Karen", "Jim", "Oscar", "Toby"] print(friends[1:4]) # not including 4

friends[1] = "Mike" # Modify a value inside the array. print(friends[1])

Recommended Posts

Memorize Python commentary 5 --Lists
Memorize Python commentary 3 --Numbers
Memorize Python commentary 4 --Input
Memorize Python commentary 2 --Strings
Memorize the Python commentary on YouTube.
Python3 | Lists, Tuples, Dictionaries
Python> Tuples versus Lists
Python lists, tuples, dictionaries
Python
Find memory-consuming lists / arrays on Python
Easily handle lists with python + sqlite3
ABC128 A, B, C commentary (python)
I'm addicted to Python 2D lists
[Python beginner] Join two lists alternately (5 lines).
Process multiple lists with for in Python
Understand python lists, dictionaries, and so on.
Python commentary whose parents were killed literally