1
0
mirror of https://github.com/satwikkansal/wtfpython synced 2024-11-23 19:44:25 +01:00
wtfpython/snippets/2_tricky_strings.py

20 lines
261 B
Python
Raw Normal View History

# 1
assert id("some_string") == id("some" + "_" + "string")
assert id("some_string") == id("some_string")
# 2
a = "wtf"
b = "wtf"
assert a is b
a = "wtf!"
b = "wtf!"
assert a is b
# 3
a, b = "wtf!", "wtf!"
assert a is b
a = "wtf!"; b = "wtf!"
assert a is b