Skip to content

Instantly share code, notes, and snippets.

@RyanMarcus
Created March 7, 2016 20:39
Show Gist options
  • Save RyanMarcus/900429f2a3ab248e3d70 to your computer and use it in GitHub Desktop.
Save RyanMarcus/900429f2a3ab248e3d70 to your computer and use it in GitHub Desktop.
Python 2 vs. 3 semantics
# Ryan Marcus 2016
# Think about what you would expect this code to print
# And then run it using Python 2.7.11 (or newer) and with Python 3
for i in range(20):
x = [i for i in range(2000, 4000)]
print(i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment