File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change 21
21
```
22
22
23
23
``` python
24
- < list > .append(< el> )
25
- < list > .extend(< collection> )
26
- < list > += [< el> ]
27
- < list > += < collection>
24
+ < list > .append(< el> ) # Or: <list> += [<el>]
25
+ < list > .extend(< collection> ) # Or: <list> += <collection>
28
26
```
29
27
30
28
``` python
@@ -45,11 +43,11 @@ list_of_chars = list(<str>)
45
43
```
46
44
47
45
``` python
48
- index = < list > .index(< el> ) # Returns first index of item.
49
- < list > .insert(index, < el> ) # Inserts item at index and moves the rest to the right.
50
- < el> = < list > .pop([index]) # Removes and returns item at index or from the end.
51
- < list > .remove(< el> ) # Removes first occurrence of item or raises ValueError.
52
- < list > .clear() # Removes all items.
46
+ index = < list > .index(< el> ) # Returns first index of item.
47
+ < list > .insert(index, < el> ) # Inserts item at index and moves the rest to the right.
48
+ < el> = < list > .pop([index]) # Removes and returns item at index or from the end.
49
+ < list > .remove(< el> ) # Removes first occurrence of item or raises ValueError.
50
+ < list > .clear() # Removes all items.
53
51
```
54
52
55
53
98
96
```
99
97
100
98
``` python
101
- < set > .add(< el> )
102
- < set > .update(< collection> )
103
- < set > |= {< el> }
104
- < set > |= < set >
99
+ < set > .add(< el> ) # Or: <set> |= {<el>}
100
+ < set > .update(< collection> ) # Or: <set> |= <set>
105
101
```
106
102
107
103
``` python
You can’t perform that action at this time.
0 commit comments