Tuple Methods and Basic Operations in Python | Python Programming

preview_player
Показать описание
Tuple:
Tuples are used to store multiple items in a single variable.
A Tuple is a collection which is ordered, unchangeable(immutable) and allow duplicate values.
Tuples are written with round brackets (parenthesis).
Create a Tuple:
Ex: t=(10,20,”robo”,40)
Create Tuple with One item:
To create a tuple with only one item, you have to add a comma after the item, otherwise python will not recognize it as a tuple.
Ex:
t=(“robo”,)
print(type(t))
t=(“robo”)
print(type(t))
Python Tuple Methods:
Python has two built-in methods that you can use on tuple.
1. count(): Return the number of times a specified value occurs in a table.
2. index(): Searches the tuple for a specified value and returns the position of there it was found.
Built-in Functions with Tuple:
Built-in functions like len(),max(),min(),sorted(),tuple(),sum(),all(),any(),enumerate() etc. are commonly used with tuple to perform different tasks.
Len():Return the length (the number of items) in the tuple.
EX: t=(10,20,”robo”,40)
print(len(t))

#PythonProgramming
#TupleMethods
#Pythontuples
#SBTechTuts

Tuple Methods and Basic Operations in Python | Python Programming
python
python progamming
python coding
python in telugu
portable
high-level
tuple
tuple methods
tuple functions
tuple basic operations
len
count
max
min
index
sorted
all
any
concatenation
sb tech tuts
sudhakar
bogam
in telugu
telugu
python tuple methods and operations
python online
learn python
Рекомендации по теме
Комментарии
Автор

Thank you for your efforts sir. Very helpful.

JRIO
Автор

Sir your explainatation is very nice but can you make a tutorial complete tutorial on mysql

rameshpogu
Автор

Sorted anni isthey
Just ascending order print avthundhi
Suppose naku descending order kavalli antey

sindhujasekhar
join shbcf.ru