Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Summary Difference between set's, list's and tuple's.

Rating
-
Sold
-
Pages
6
Uploaded on
06-06-2023
Written in
2022/2023

This pdf provides detailed and elaborated information on set's, tuple's and list's in python.

Institution
Course

Content preview

Differences
between list’s,
tuples and set’s

, LIST TUPLE SET
 Definition: In ➢ Definition: In ➢ Definition: In
Python, a list is a Python, a tuple is a Python, a set is an
collection of items collection of items unordered
that are ordered. It that are ordered. It collection of
is defined using is defined using unique items. It is
square brackets [], parentheses (), defined using curly
with individual with individual braces {}, with
items separated by items separated by individual items
commas. commas. separated by
 Properties:  Properties: commas.
➢ Mutable: Lists are ➢ Immutable: Tuples  Properties:
mutable, which are immutable, ➢ Unordered: Sets
means that we can which means their are unordered,
add, remove, or contents cannot be meaning that the
modify items after changed once they order of their
the list has been are created. This is elements is not
created. different from lists, guaranteed.
➢ Ordered: Lists are which are mutable.
➢ Unique elements:
ordered, which ➢ Ordered: Tuples
Sets contain only
means that the maintain the order
unique elements,
items in the list of their elements.
This means that meaning that
have a specific
the first element of there can be no
order. We can
the tuple will duplicates.
access individual ➢ Mutable: Sets are
always be the first
items in a list using
element, the mutable, meaning
their index, which
second element that you can add
starts at 0. We can will always be the or remove
also use slicing to second element, elements after the
extract a portion and so on. set is created.
of the list. ➢ Indexable: Tuples ➢ Iterable: Sets are
➢ Heterogeneous: can be accessed iterable, which
Lists can contain using indexing. means we can use
any combination This means that a loop to iterate
of data types, you can retrieve a over all their
including integers, specific element of
elements.
floats, strings, a tuple by
➢ Hashable: Sets are
Booleans, and hashable, which

Written for

Institution
Course

Document information

Uploaded on
June 6, 2023
Number of pages
6
Written in
2022/2023
Type
SUMMARY

Subjects

$10.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
galetishowryjames

Get to know the seller

Seller avatar
galetishowryjames Gitam University
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
2 year
Number of followers
0
Documents
20
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions