What is Tuple Operations in Python | EP-11 Tuple Operations in Python | Basic Tuple Operations

Subscribers:
27,900
Published on ● Video Link: https://www.youtube.com/watch?v=qggfp2JoNBI



Duration: 13:55
150 views
5


#PythonTupleOperations
"""
1. Accessing of Python Tuples
2. Concatenation of Tuples
3. Slicing of Tuple
4. Deleting a Tuple"""

1. Accessing of Tuples
""" In Python Programming, Tuples are immutable, and usually, they contain a
sequence of heterogeneous elements that are accessed via unpacking or indexing
(or even by attribute in the case of named tuples).

Note:
In unpacking of tuple number of variables on the left-hand side should be equal
to a number of values in given tuple a. """

Tuple unpackingcon_1 = (1,2,3)
con_2 =("a","b")
company = ("cybrosys","technologies")
a,b =company
print("a",a)
print("b",b)
print("company",company)

2. Concatenation of Tuples
"""Concatenation of tuple is the process of joining two or more Tuples.
Concatenation is done by the use of ‘+’ operator. Concatenation of tuples is
done always from the end of the original tuple. Other arithmetic operations do
not apply on Tuples.

Note- Only the same datatypes can be combined with concatenation, an error
arises if a list and a tuple are combined."""

Concatenation of tuples

con1 =(1,2,3)
con2 = ("A","b")
result = con1 + con2
print(result)

con3 =tuple([7,8])
r = con2 +con3

3. Slicing of Tuple
"""
Slicing of a Tuple is done to fetch a specific range or slice of sub-elements
from a Tuple. Slicing can also be done to lists and arrays. Indexing in a list
results to fetching a single element whereas Slicing allows to fetch a set of
elements.

Note- Negative Increment values can also be used to reverse the sequence of
Tuples.
"""
Slicing of a Tuple
company1 =("cybrosys")


Removing First element
print("Removal of First Element: ")
print(company1[1:])


Reversing the Tuple
print("\nTuple after sequence of Element is reversed: ")
print(company1[::-1])


Printing elements of a Range
com = ("cybrosys")
print("\nPrinting elements between Range 4-6: ")
print(com[4:6])


4. Deleting a Tuple
"""Tuples are immutable and hence they do not allow deletion of a part of it.
The entire tuple gets deleted by the use of del() method.

Note- Printing of Tuple after deletion results in an Error.
syntax:del object"""
tuple1 = (1,2,3)
del tuple1
print(tuple1)

#Python #Programming #PythonProgramming #Tutorial #BeginnerPython #LearnPython #Tuples #PythonOperations #DataStructures #TupleOperations #Coding #PythonTutorial #PythonBasics #AdvancedPython #PythonCode

Connect With Us:
—————————————
➡️ Website: https://www.cybrosys.com/
➡️ Email: info@cybrosys.com
➡️ Twitter:   / cybrosys  
➡️ LinkedIn:   / cybrosys  
➡️ Facebook:   / cybrosystechnologies  
➡️ Instagram:   / cybrosystech  
➡️ Pinterest:   / cybrosys  




Other Videos By Cybrosys Technologies


2024-07-15How to Create a Ticket From Forum Post in Odoo 18 | New & Latest Features in Odoo 18 | Odoo 18 Forum
2024-07-15How to Create Editable Tree View in Odoo 17 | Odoo 17 Development Tutorials | Tree View in Odoo 17
2024-07-15How to Get First & Last Elements From a Tuple in Python | EP-14 Get First & Last Elements from Tuple
2024-07-14How to Create Invoice Upon Email in Odoo 17 Accounting App | Odoo 17 Functional Tutorials
2024-07-14How to Find & Print the Size of a Tuple in Python | EP-13 Find the Size of a Tuple | What is Tuple?
2024-07-11How to Create a Product in Odoo 18 POS | Odoo 18 Latest Features | Odoo 18 New & Upcoming Features
2024-07-11How to Sell Your Products in Odoo 17 Website App | Odoo 17 Website Tutorials | Functional Tutorials
2024-07-10What is Set in Python | EP-12 Sets in Python | How to Create Set in Python | Free Python Tutorials
2024-07-10Revamp in Product View in Odoo 18 | Latest Features in Odoo 18 | New & Upcoming Features in Odoo 18
2024-07-09How to Create an App Using Odoo 17 Studio | Customize App Using Odoo 17 Studio | Odoo 17 Tutorials
2024-07-08What is Tuple Operations in Python | EP-11 Tuple Operations in Python | Basic Tuple Operations
2024-07-07What is Tuple in Python | EP-10 Tuple in Python | How to Create Tuple in Python | Built-in Functions
2024-07-07How to Configure Sales Team & Team Members in Odoo 17 Sales | Odoo 17 Functional Tutorials
2024-06-13How to Unbuild Order in Odoo 17 Manufacturing App | Odoo 17 Manufacturing Tutorials | Odoo 17 Videos
2024-06-12How to Manage Employee Assets in Horilla HRMS | Free HR Software | An Overview of Assets Management
2024-06-12How to Configure Access Rights of Manufacturing Orders in Odoo 17 Manufacturing App | Odoo 17 Videos
2024-06-11How to Manage Work Order Dependencies in Odoo 17 Manufacturing App | Odoo 17 Functional Tutorials
2024-06-11How to Configure Manufacturing in 3 Steps in Odoo 17 Manufacturing App | Odoo 17 Functional Tutorial
2024-06-10What is the Difference Between Search & Browse Methods in Odoo 17 | ORM Methods | Odoo 17 Videos
2024-06-10How to Make Work Centers Unavailable Using Time Off in Odoo 17 | Odoo 17 Functional Tutorials
2024-06-07How to Configure Split & Merge Manufacturing Orders in Odoo 17 Manufacturing App | Odoo 17 Tutorials



Tags:
Python
Programming Tutorial
Tuples
Data Structures
Python for Beginners
Python Operations
Tuple Operations
Programming
Coding
Learn Python
Python Tutorial
Python Basics
Advanced Python
Python Code
Python Tips
Python Programming
Python Guide
Tech Tonic
Tuple Methods
Tuple Unpacking
Tuple Nesting
Python Data Structures
Tuple Indexing
Tuple Concatenation
Tuple Slicing
Immutable Data Structures
Built-in Functions
Deleting a Tuple
Tuple Operation