0

guys i m trying to convert tuples which r inside a list into list...but i m getting an error...plz check my code

https://code.sololearn.com/cXGTN5sPQ5TB/?ref=app

25th May 2020, 8:06 AM
PRO
PRO - avatar
4 Antworten
+ 1
Your issue is that you have "list" as a parameter to your function, aswell as using "list" to try to convert your tuples to a list. Also, changing each tuple to a list is not enough in itself. You then need to change the element in your outer list to this new (list) element. Try changing your list_maker function to this: def list_maker(lst): for idx, tup in enumerate(lst): lst[idx] = list(tup) return lst Of course, 𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 's solution works but I thought you may benefit from knowing why yours didn't.
25th May 2020, 8:19 AM
Russ
Russ - avatar
+ 1
ohh...i got it...thanks for being so explicit Russ..thank you 𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 too
25th May 2020, 9:14 AM
PRO
PRO - avatar