Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- # Para autocompletado de parentesis, corchetes, etc en Geany
- # editar->preferencias->editor->completado
- """
- #
- # Ingresar tres numeros y calcular el promedio
- a = float(input("Ingrese un nro: "))
- b = float(input("Ingrese un nro: "))
- c = float(input("Ingrese un nro: "))
- print(f"El promedio es {(a+b+c)/3:.2f}")
- """
- lista = []
- i=0
- while i<3:
- a = float(input("Ingrese un nro: "))
- lista.append(a)
- i = i + 1
- print(f"El promedio es {sum(lista)/len(lista):.2f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement