Tuple Methods and Basic Operations in Python | Python Programming

Опубликовано: 20 Август 2021
на канале: SB Tech Tuts
8,352
162

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))

Subscribe my channel : www.youtube/SBTechTuts

#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


На этой странице сайта вы можете посмотреть видео онлайн Tuple Methods and Basic Operations in Python | Python Programming длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь SB Tech Tuts 20 Август 2021, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 8,352 раз и оно понравилось 162 зрителям. Приятного просмотра!