mirror of
https://github.com/davrot/pytutorial.git
synced 2025-04-27 01:26:04 +02:00
Update README.md
Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
parent
7d1de5f948
commit
8f504b21d2
1 changed files with 22 additions and 0 deletions
|
@ -229,6 +229,28 @@ print("AA" not in collection_of_strings) # -> False
|
||||||
print("XX" not in collection_of_strings) # -> True
|
print("XX" not in collection_of_strings) # -> True
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## +
|
||||||
|
|
||||||
|
```python
|
||||||
|
collection_of_strings_a = [
|
||||||
|
"AA",
|
||||||
|
"BB",
|
||||||
|
"CC",
|
||||||
|
"DD",
|
||||||
|
]
|
||||||
|
collection_of_strings_b = [
|
||||||
|
"EE",
|
||||||
|
"FF",
|
||||||
|
"GG",
|
||||||
|
"HH",
|
||||||
|
]
|
||||||
|
print(collection_of_strings_a) # -> ['AA', 'BB', 'CC', 'DD']
|
||||||
|
print(collection_of_strings_b) # -> ['EE', 'FF', 'GG', 'HH']
|
||||||
|
collection_of_strings = collection_of_strings_a + collection_of_strings_b
|
||||||
|
|
||||||
|
print(collection_of_strings) # -> ['AA', 'BB', 'CC', 'DD', 'EE', 'FF', 'GG', 'HH']
|
||||||
|
```
|
||||||
|
|
||||||
## [Additional commands](https://docs.python.org/3/tutorial/datastructures.html)
|
## [Additional commands](https://docs.python.org/3/tutorial/datastructures.html)
|
||||||
|
|
||||||
||
|
||
|
||||||
|
|
Loading…
Add table
Reference in a new issue