Created
December 25, 2019 06:06
-
-
Save strager/20454f445e5e4eee75006d0ac87c8ea7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = 1 | |
y = x | |
x += 2 | |
print("numbers:", x, y) | |
# numbers: 3 1 | |
x = ("hello",) | |
y = x | |
x += ("world",) | |
print("tuples:", x, y) | |
# tuples: ('hello', 'world') ('hello',) | |
x = ["hello"] | |
y = x | |
x += ["world"] | |
print("lists:", x, y) | |
# lists: ['hello', 'world'] ['hello', 'world'] | |
# Program output: | |
# numbers: 3 1 | |
# tuples: ('hello', 'world') ('hello',) | |
# lists: ['hello', 'world'] ['hello', 'world'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment