Skip to content

Instantly share code, notes, and snippets.

@melvinkcx
Created June 30, 2019 06:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save melvinkcx/41dee5c62467dc648925a6a3e0ac3b0d to your computer and use it in GitHub Desktop.
Save melvinkcx/41dee5c62467dc648925a6a3e0ac3b0d to your computer and use it in GitHub Desktop.
Filtering Dictionary in Python 3.7
import random
data = {
1: 1,
2: 2,
3: 3
}
# This will raise an Error
for k in data:
rand = random.randint(4, 2^31)
data[rand] = rand
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment