
Spencer H. answered 07/03/21
I can help you build a foundation in python and data science
Here's an example of what the code would look like
'''
state = ["PA","NJ", "DE","MN","NH"]
zipcode = ["19063","18076","19067","24298","13890"]
def writeTo(zips=zipcode, state=state):
firstName = input("Enter your first name")
lastName = input("Enter your last name")
address = input("Enter your address")
city = input("Enter your city")
State = input("Enter your state")
if State in state:
ix = 0
for i in range(len(state)):
if state[i] == State:
ix = i
zipCode = zips[ix]
else:
zipCode = input("Enter your zip code")
results = {'LastName': [lastName], 'FirstName': [firstName],
'Street Address': [address], 'City': [city],
'State': [State], 'ZipCode': [zipCode]}
return result'''
I stored the results in a dictionary but you can convert it to a csv file with pd.to_csv if you want, that way the data will be independant columns.