Update README.md
Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
parent
2ee5059874
commit
7d1de5f948
1 changed files with 19 additions and 0 deletions
|
@ -210,6 +210,25 @@ del collection_of_strings[1]
|
||||||
print(collection_of_strings) # -> ['AA', 'CC', 'DD']
|
print(collection_of_strings) # -> ['AA', 'CC', 'DD']
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## in
|
||||||
|
|
||||||
|
```python
|
||||||
|
collection_of_strings = [
|
||||||
|
"AA",
|
||||||
|
"BB",
|
||||||
|
"CC",
|
||||||
|
"DD",
|
||||||
|
"EE",
|
||||||
|
"FF",
|
||||||
|
"GG",
|
||||||
|
"HH",
|
||||||
|
]
|
||||||
|
print("AA" in collection_of_strings) # -> True
|
||||||
|
print("XX" in collection_of_strings) # -> False
|
||||||
|
print("AA" not in collection_of_strings) # -> False
|
||||||
|
print("XX" not in collection_of_strings) # -> True
|
||||||
|
```
|
||||||
|
|
||||||
## [Additional commands](https://docs.python.org/3/tutorial/datastructures.html)
|
## [Additional commands](https://docs.python.org/3/tutorial/datastructures.html)
|
||||||
|
|
||||||
||
|
||
|
||||||
|
|
Loading…
Reference in a new issue