Skip to content

Instantly share code, notes, and snippets.

@Spebby
Created September 23, 2022 20:07
Show Gist options
  • Save Spebby/736659ba33d20861218a435cf900493a to your computer and use it in GitHub Desktop.
Save Spebby/736659ba33d20861218a435cf900493a to your computer and use it in GitHub Desktop.
Takes in a pre-1988 Nevada DL and spits out the Birthdate and SSN used to create it.
#!/usr/bin/env python3
"""Takes in a pre-1988 Nevada DL and spits out the Birthdate and SSN used to create it."""
from datetime import date
todays_date = date.today()
fName = input().lower().title()
midName = input().lower().title()
lName = input().lower().title()
DL = input().upper().replace(" ", "").replace("-", "")
intSSN = int(DL)
intSSN = int((((intSSN / 100) - 2600000001) / 2))
# assumes they were born Jan 1st
age = todays_date.year - (1900 + int(DL[len(DL) - 2: len(DL)]))
SSN = str(intSSN).zfill(9)
# insert - into ssn after 3rd and 5th index
SSN = SSN[:3] + "-" + SSN[3:5] + "-" + SSN[5:]
print(f"{lName}, {fName} {midName}")
print(f"{SSN}")
print(f"{age}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment