LordKusa

Calcular mayor y menor de una lista

May 22nd, 2018
212
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def app():
  2.     mayor = 0
  3.     menor = 999
  4.     valores = []
  5.     print("De 10 numeros, sacar el mayor y el menor")
  6.     for i in range(5):
  7.         valor = int(input("Ingrese un numero: "))
  8.         valores.append(valor)
  9.     for j in range(5):
  10.         if valores[j] >= mayor:
  11.             mayor = valores[j]
  12.         if valores[j] <= menor:
  13.             menor = valores[j]
  14.     print("El numero mayor es ", mayor)
  15.     print("El numero menor es ", menor)
RAW Paste Data