Advertisement
teslariu

listas

Jul 5th, 2022
1,094
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Para autocompletado de parentesis, corchetes, etc en Geany
  5. # editar->preferencias->editor->completado
  6. """
  7. #
  8. # Ingresar tres numeros y calcular el promedio
  9. a = float(input("Ingrese un nro: "))
  10. b = float(input("Ingrese un nro: "))
  11. c = float(input("Ingrese un nro: "))
  12.  
  13. print(f"El promedio es {(a+b+c)/3:.2f}")
  14.  
  15. """
  16. lista = []
  17. i=0
  18. while i<3:
  19.     a = float(input("Ingrese un nro: "))
  20.     lista.append(a)
  21.     i = i + 1
  22. print(f"El promedio es {sum(lista)/len(lista):.2f}")
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement