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
4 Respostas
+ 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.
+ 1
ohh...i got it...thanks for being so explicit Russ..thank you 𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 too