Skip to content

Instantly share code, notes, and snippets.

@sammoorhouse
Last active February 21, 2019 12:52
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 sammoorhouse/d151cafd9289d8223205cd064fa76008 to your computer and use it in GitHub Desktop.
Save sammoorhouse/d151cafd9289d8223205cd064fa76008 to your computer and use it in GitHub Desktop.
people = {
"sam": 1984,
# ...
}
def getAge(dob):
return 2019 - dob
ages = [getAge(dob)
for name, dob in people.items()
if getAge(dob) > 30]
for age in ages:
print(age)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment