Definition
Tuple and List are used to store data in Python Language.Tuple: A tuple is a collection of values and it is declared using parentheses. However, we can also use a tuple packing to do the same, and unpacking to assign its values to a sequence.
Lists: Unlike in C++, we don’t have arrays to work with in Python . Here, we have a list instead.
· Mutability
o A List is Mutableo B Tuple is Immutable
· In built Methods:
o Following Methos can apply to List append(), insert(), remove(), pop(), clear(), sort(), and reverse().o But not applicable to Tuple.
· Inside Storage
o We can store tuples in a list when we want to. For example,o [(1, ‘ABC’), (2, ‘DEF’), (3, ‘GHI’)]
o Lists in a Tuple
o Likewise, we can also use a tuple to store lists. Let’s see how.· Use:
o >>> mytuple=([1,2],[3,4],[5,6])o Use a tuple when you know what information goes in the container that it is. For example, when you want to store a person’s credentials for your website.
o >>> person=('ABC','admin','12345')o But when you want to store similar elements, like in an array in C++, you should use a list.
o >>> groceries=['bread','butter','cheese']
TCCI-Tririd Computer Coaching Institute is focused on providing Quality education with practical sessions. We pride ourselves for providing proficient IT solutions. We have a highly qualificated and expereinced faculties, who provide teaching for all computer subjects and All Engineering Course .
Call us @ 98256 18292
Visit us @ http://tccicomputercoaching.com/
Smm panel
ReplyDeleteSMM PANEL
iş ilanları
instagram takipçi satın al
Https://www.hirdavatciburada.com
beyazesyateknikservisi.com.tr
servis
tiktok jeton hilesi
ümraniye alarko carrier klima servisi
ReplyDeletekartal daikin klima servisi
maltepe samsung klima servisi
çekmeköy vestel klima servisi
ataşehir vestel klima servisi
ataşehir bosch klima servisi
beykoz vestel klima servisi
üsküdar arçelik klima servisi
tuzla vestel klima servisi