YouTube Link: https://youtu.be/GstQPTWpt88
** Python Certification Training: https://www.edureka.co/data-science-python-certification-course **
This Edureka video on 'Tuple In Python' will help you understand how we can use Tuple in Python with various examples for better understanding. Following are the topics discussed:
What Is Tuple In Python?
Accessing Elements In A Tuple
Changing A Tuple
Concatenating Two Tuples
Deleting A Tuple
Tuple Methods
List vs Tuple
Tuple Constructor
Other Examples
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
2. What Is Tuple In Python?
Accessing Elements In A Tuple
Changing A Tuple
www.edureka.co/python
Concatenating Two Tuples
Deleting A Tuple
Tuple Methods
List vs Tuple
Tuple Constructor
Other Examples
4. www.edureka.co/python
A tuple is an immutable data type in python,
almost similar to a list in python in terms of
indexing and having duplicate members. It
is a collection data type that stores python
objects separated by commas.
6. Accessing
Elements In A
Tuple
www.edureka.co/python
• A web-crawler is also known as a web spider,
automatic indexer or simply crawler.
• It is an internet bot that helps in web indexing
• Web crawlers helps in collecting information
from a webpage and the links related to them
• It also helps in validating HTML code and
hyperlinks.
• They crawl one page at a time until all the
pages are indexed.
Indexing It is a data structure technique to
effectively retrieve information from a data
structure. In python, several data types
support indexing
Slicing is a technique in which we use the
slicing operator ‘:’ to get a range of elements
from a tuple or any other data type that
supports indexing for accessing elements.
8. Changing A Tuple
www.edureka.co/python
To install scrapy, simply run the following command in
the command prompt or in the terminal, or simply you
can add the package from the project interpreter too.Even though tuples in python are immutable in nature, a
nested object in a tuple can be changed. Or in general, a tuple in
python can be reassigned with a different value.
10. Joining two tuples is a very easy task.
You just to assign the addition of the two
tuples to another variable and it will
return the concatenated tuple with the
values of both the tuples
Concatenating
Two Tuples
www.edureka.co/python
12. Deleting A
Tuple
www.edureka.co/python
Being an immutable data type, a tuple
in python does not allow any changes
and you cannot even remove an
element from a tuple after the
declaration. But there is a keyword ‘del’
which will delete the tuple altogether.
16. List vs Tuple
www.edureka.co/python
•Used for homogenous data types
•Mutable in nature
•Does not have immutable elements
•No guarantee that the data is write-protected
•Generally used for heterogeneous data types
•Immutable in nature, which helps in faster iteration
•Immutable elements can be used as a key for a
dictionary
•Implementing a tuple with data that does not
change guarantees that it is write-protected