Sep-03-2021, 12:53 AM
I'd go with what menator01 said.
Below is just a variation on his theme.
Below is just a variation on his theme.
day, month, year = [x for x in input("enter day, month, year values, separated by a space : ") .split() ] dob = day + '/' + month + '/' + yearCould add more, like first name and surname and make a dictionary:
dob_dict = {} # a little function to save the name and dob def getDOBs(): fname, sname, day, month, year = [x for x in input("enter 1 firstname, surname, day, month, year values, separated by a space : ") .split() ] name = fname + ' ' + sname dob_dict[name] = day + '/' + month + '/' + year print('added', name + ' to the dob dictionary') # just enter getDOBs() getDOBs()dob_dict looks like:
Quote:>>> dob_dict
{'Peter Smith': '22/02/2020', 'John Jones': '23/03/1990'}