Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def lista_nombres():
- nombres = []
- ok = False
- repeticiones = 0
- while ok == False:
- x = input("Ingresa un nombre o 0 para terminar: ")
- if x == "0":
- ok == True
- break
- if x in nombres:
- print("El nombre ya está en la lista.")
- repeticiones = repeticiones + 1
- nombres.append(x)
- return nombres, repeticiones
- nombres, repeticiones = lista_nombres()
- print("La lista es: ", nombres)
- print( repeticiones/len(nombres))
- print(repeticiones)
- def lista_nombres():
- return ("Valor1", "Valor2")
- v1, v2 = lista_nombres()
- v1, _ = lista_nombres()
Add Comment
Please, Sign In to add comment