tuple python
tuple = ("Facebook", "Instagram", "TikTok", "Twitter")
moi_crn
tuple = ("Facebook", "Instagram", "TikTok", "Twitter")
a=(1,2,3,4)
print(a[-3])
tupel python
strs = ['ccc', 'aaaa', 'd', 'bb'] print sorted(strs, key=len) ## ['d', 'bb', 'ccc', 'aaaa']
#the list will be sorted by the length of each argument
count(x) : Returns the number of times 'x' occurs in a tuple
index(x) : Searches the tuple for 'x' and returns the position of where it was first found
#Python has two built-in methods that you can use on tuples.
#Method Description
count()
Returns the number of times a specified value occurs in a tuple
index()
Searches the tuple for a specified value and returns the position
of where it was found