“Metody krotek w Pythonie” Kod odpowiedzi

Tuple Python

tuple = ("Facebook", "Instagram", "TikTok", "Twitter")
moi_crn

Tuplein Python

a=(1,2,3,4)
print(a[-3])

Coder Cat

Tuple Python

tupel python
Ma

Krotki w Pythonie

  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
Happy Heron

Metody krotek Pythona

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
MayMau

Metody krotek w Pythonie

#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
Asif Iqbal Paracha

Odpowiedzi podobne do “Metody krotek w Pythonie”

Pytania podobne do “Metody krotek w Pythonie”

Więcej pokrewnych odpowiedzi na “Metody krotek w Pythonie” w Python

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu