You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 04 More on Variables/2 Lists.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ list = ['A', 'B', 'C', 'D']
29
29
30
30
del list[1] # delete the second element
31
31
32
-
print(list) # ['A', 'C', 'D']
32
+
print(list) # ['A', 'C', 'D']
33
33
```
34
34
35
35
It is also possible to insert and add items to the list. They are used to this method with names `insert` and `append`. These methods are specific operations related to a variable of a given type. They are similar to a function, but affect only one specific object. They are called as follows `object.method(arguments...)`, where object is usually a variable name, and the method name is separated from the object by a period. Adding an item to the list will look like this:
0 commit comments