Using tuples in a function

Please read the pinned thread in order to understand this. Also, as general advice: you should make sure to use a monospace (“typewriter”) font in the program that you use to edit your code, and indent the code with spaces, not tabs. In the long run, this will make it much easier to read the code (which is very important, because you will spend much more time reading your own code than you spend writing it). It will also make it easier for you to “shift” visually between your code editor and a terminal window (and please don’t think “I’ll just make the terminal window use a ‘normal’ font”; if your OS even gives you the option, it will make Python’s error messages look wrong - they’re specially designed to use that typewriter formatting).

Anyway, there is still not enough information here to understand the problem. You tell us “I found no way to convert the tuple to a list inside the function”, but we can’t know which function is “the function” from this. I guess, from the code that you showed, that you are talking about trying to call update_rec. However, we cannot guess what this function does, therefore we cannot guess what is valid to pass to it when calling it, therefore we cannot guess how to transform the list1 and list2 that you have into an acceptable call to the function. (We cannot even know that it makes any sense at all to try.) The variable names in the program also do not give us a hint: when something is called list1 or list2, that does not help us understand the purpose of that variable. From the rest of the code, I get the basic idea that you are trying to query a database using MySQLdb, and then create some data that you will use to update_rec something. I guess this means to use someone else’s function that will update a record in the database. But I can’t know that, and I can’t know how it will be updated, and I can’t know what should be provided to the function, and I can’t know the rules that the function will use to understand what was provided. I also can’t know what went wrong when you tried the code, because you did not show us.