“Acceso al índice de tupla de Python” Código de respuesta

Índice de tupla en Python

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

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

Acceso al índice de tupla de Python

#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

Respuestas similares a “Acceso al índice de tupla de Python”

Preguntas similares a “Acceso al índice de tupla de Python”

Más respuestas relacionadas con “Acceso al índice de tupla de Python” en Python

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código