Skip to content

Instantly share code, notes, and snippets.

@frantizek
Last active February 12, 2024 18:04
Show Gist options
  • Save frantizek/c34ab63beddaf3e0242dfc5f338e53cc to your computer and use it in GitHub Desktop.
Save frantizek/c34ab63beddaf3e0242dfc5f338e53cc to your computer and use it in GitHub Desktop.
Generation Identifier
print("Generation Identifier")
print("-"*40)
print("\n")
birth_year = int(input("Which year were you born ? "))
if birth_year >= 1883 and birth_year <= 1900:
print("Lost Generation.")
elif birth_year >= 1901 and birth_year <= 1927:
print("Greatest Generation.")
elif birth_year >= 1928 and birth_year <= 1946:
print("Silent Generation.")
elif birth_year >= 1947 and birth_year <= 1964:
print("Baby Boomers.")
elif birth_year >= 1965 and birth_year <= 1981:
print("Generation X.")
elif birth_year >= 1982 and birth_year <= 1995:
print("Generation Y.")
elif birth_year >= 1997 and birth_year <= 2012:
print("Generation Z.")
elif birth_year > 2013 and birth_year <= 2024:
print("Generation Alpha.")
else:
print("You are not a part of any generation.")
@cibervicho
Copy link

cibervicho commented Feb 11, 2024

Is this correct?

elif birth_year >= 1947 and birth_year <= 1964:
  print("Baby Boomers.")
  
elif birth_year >= 1982 and birth_year <= 1995:
  print("Baby Boomers.")

Those between 1982 and 1995 should be "Generation Y" Aren't they?

@frantizek
Copy link
Author

Yep. You are correct.
A typo combined with a "copy and paste".
Let me fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment