Tuple Methods and Basic Operations in Python | Python Programming

Pubblicato il: 20 agosto 2021
sul canale di: 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


In questa pagina del sito puoi guardare il video online Tuple Methods and Basic Operations in Python | Python Programming della durata di ore minuti seconda in buona qualità , che l'utente ha caricato SB Tech Tuts 20 agosto 2021, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 8,352 volte e gli è piaciuto 162 spettatori. Buona visione!