# Lists are defined by using "[]" and inserting elements between these brackets.
friends = ["Kevin", "Karen", "Jim", "Oscar", "Toby"]

# Print all the elements in the list.
print(friends)

# Print the first element in the list.
print(friends[0])

# Print the last element in the list.
print(friends[-1])

# Print all elements in the list starting from the second one.
print(friends[1:])

# Print all elements in the list from the second one up to the third one.
print(friends[1:3])

# Replace the second element in the list and print it.
friends[1] = "Mike"

print(friends[1])

# Lists are defined by using "[]" and inserting elements between these brackets.
friends = ["Kevin", "Karen", "Jim", "Oscar", "Toby"]

# Print all the elements in the list.
print(friends)

# Print the first element in the list.
print(friends[0])

# Print the last element in the list.
print(friends[-1])

# Print all elements in the list starting from the second one.
print(friends[1:])

# Print all elements in the list from the second one up to the third one.
print(friends[1:3])

# Replace the second element in the list and print it.
friends[1] = "Mike"

print(friends[1])

# Lists are defined by using "[]" and inserting elements between these brackets. # Print all the elements in the list. # Print the first element in the list. # Print the last element in the list. # Print all elements in the list starting from the second one. # Print all elements in the list from the second one up to the third one. # Replace the second element in the list and print it.