“Dostęp do indeksu Python Tuple” Kod odpowiedzi

indeks krotek w Pythonie

# Creating a tuple using ()
t = (1, 2, 4, 5, 4, 1, 2,1 ,1)

print(t.index(5))
Coding boy Hasya

Dostęp do indeksu Python Tuple

#Read in the input using input()
user_input = ()

#Use the .count()
first_word = user_input[0]
print(first_word)

#Find how many times first_word exists in the remainder of the str
remainder = user_input[1:]
print('{} exists in {} {} times.'.format(first_word, remainder, remainder.count(first_word)))
Matthew Sundgren

Odpowiedzi podobne do “Dostęp do indeksu Python Tuple”

Pytania podobne do “Dostęp do indeksu Python Tuple”

Więcej pokrewnych odpowiedzi na “Dostęp do indeksu Python Tuple” w Python

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

Przeglądaj inne języki kodu