Skip to content

Instantly share code, notes, and snippets.

@sloanlance
Last active December 20, 2023 02:29
Show Gist options
  • Save sloanlance/8aff360e474a065c472ed1a4cd05762a to your computer and use it in GitHub Desktop.
Save sloanlance/8aff360e474a065c472ed1a4cd05762a to your computer and use it in GitHub Desktop.
Python's handling of Unicode-character variables is surprising!
๐€ = {'๐Ÿ˜€': 5}
for โ„น๏ธŽ in range(20):
# print(i, โ„น๏ธŽ, i == โ„น๏ธŽ) # NameError: name 'i' is not defined.
for _,__ in ๐€.items():
if __ == โ„น๏ธŽ:
print(_, โ„น๏ธŽ)
print(๐€) # Prints dictionary in ๐€
print(A) # Also prints dictionary in ๐€!
print(๐€ is A) # True
๐—ต๐—ฒ๐—น๐—น๐—ผ = 'Hello'
print(๐—ต๐—ฒ๐—น๐—น๐—ผ) # Hello
print(hello) # Hello
print(๐—ต๐—ฒ๐—น๐—น๐—ผ is hello) # True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment