Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
tuple_frutas = ("manzana", "plátano", "cereza")
print(tuple_frutas)
tuple_frutas = ("manzana", "plátano", "cereza")
print(tuple_frutas[1])
print(tuple_frutas[-1])
' 0 1 2 3 4 5 6'
tuple_frutas = ("manzana", "plátano", "cereza", "piña", "limón", "fresa", "uva")
print(tuple_frutas[2:5])
print(tuple_frutas[-7:-3])
x = ("manzana", "plátano", "cereza")
y = list(x)
y[1] = "kiwi"
x = tuple(y)
print(x)
tuple_frutas = ("manzana", "plátano", "cereza")
tuple_frutas[3] = "piña" #Esto creará un error
print(tuple_frutas)
#https://hetpro-store.com/TUTORIALES/tuples-en-python:-6---colecciones
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment