How to store data values from a tuple into a list? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 3

How to store data values from a tuple into a list?

6th Sep 2017, 6:38 AM
Ritwik Tripathi
Ritwik Tripathi - avatar
2 Réponses
+ 5
tupleA = (1,2,3) listA = list(tupleA) #[1,2,3] is that what you mean?
6th Sep 2017, 6:52 AM
Abdur-Rahmaan Janhangeer
Abdur-Rahmaan Janhangeer - avatar
+ 1
Tuple is immutable (unmodified) list. you can do with it all what you can with list but modify or change it. example, for x in TupleA: print(x) will work.
6th Sep 2017, 7:19 AM
yuri