Hello all, I recently started learning Python.
So I have an example of a couple of lists I would like to combine them into a tuple to eventually store in SQL Server.
person1 = ['name', 'john Doe', 'gender', 'male', 'length', '189', 'department', 'Finance', 'HireDate', '2005-0102']
person2 = ['name', 'Sara John', 'gender', 'length', '160', 'department', 'Sales']
person3 = ['name', 'Sam Anders', 'department', 'Finance']
I have a function that fetches the data inside. and with
except (IndexError) :
I make sure the parameter is always filled.
So if someone could give me some advice on how to proceed with creating a tuple with the column names in the values (see bold text in example)correct name without shifting. So in the example, there are only 10 items but in my file, there are 32 just for context.
Thanks in advance.