Python Tuple and Tuple Manipulation | Python Programming in Tamil | #13
In this video we are going to answer the following questions
Python Tuple ?
Python Tuple Management ?
---------------------
Python Tuple
---------------------
Tuples consists of a number of values separated by comma and enclosed within parentheses ().
Tuple is similar to list, values in a list can be changed but not in a tuple
-------------------------------------------------
Advantages of Tuples over list
-------------------------------------------------
1. The elements of a list are changeable (mutable) whereas the elements of a tuple are unchangeable (immutable), this is the key difference between tuples and list.
2. The elements of a list are enclosed within square brackets. But, the elements of a tuple are enclosed by parentheses.
3. Iterating tuples is faster than list.
-------------------------------
Tuple Manipulation
-------------------------------
Creating a Tuple
T = (“Sriram”, ”Vignesh”, 10, 20.40, 1)
Accessing characters in a Tuple
0 1 2 3 4
sriram vignesh 10 20.40 1
-5 -4 -3 -2 -1
T[-3] # 10
T[4] # 1
--------------------------------------
Python Tuple Operators
--------------------------------------
Python provides the following operators for Tuple operations. These operators are useful to manipulate List
(i) Concatenation (+)
Tuple1 + Tuple2
(ii) Append (+ =)
Tuple1 = (“Hello ”)
Tuple1 += ("Learn Python“)
(iii) Repeating (*)
Tuple1 = (“Hi”,)
print (Tuple1*4) # HiHiHiHi
(iv) Tuple slicing
Tuple1[start:end:difference]
Tuple1[0:5:2]
You can download Python from https://www.python.org/
****************************************************************************
YouTube - / @sriramasubramaniamnagarajan
Connect me @
facebook: https://www.facebook.com/profile.php?...
instagram: / sriramasubramaniam
sololearn: https://www.sololearn.com/Profile/104...
PlayList:
C programming - • C Programming Language
Python Programming - • Python Programming
canva - https://www.canva.com/join/simplified...
In questa pagina del sito puoi guardare il video online Python Tuple and Tuple Manipulation | Python Programming in Tamil | #13 della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Sriramasubramaniam Nagarajan 04 luglio 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 123 volte e gli è piaciuto 4 spettatori. Buona visione!