Advertisement
teslariu

lista nombre

Jan 12th, 2022
1,058
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4.  
  5. """
  6. Escriba un programa que permita crear una lista de
  7. nombres. Para ello, el programa tiene que pedir un
  8. número y luego solicitar esa cantidad de nombres para
  9. crear la lista. Por último, el programa tiene que mostrar
  10. la lista creada."""
  11.  
  12. cant = int(input("Ingrese la cantidad: "))
  13. i = 0
  14. name = []
  15. while i < cant:
  16.     # nombre = input(f"Ingrese {i+1}º nombre: ")
  17.     # name.append(nombre)
  18.     name.append(input(f"Ingrese {i+1}º nombre: "))
  19.     i = i + 1
  20. print(name)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement