Advertisement
Guest User

Confidential files [FP]

a guest
Oct 22nd, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. print("Programa \n")
  2. def lista():
  3. while True:
  4. num = input("Número: ")
  5. if num == "":
  6. break
  7. lst.append(float(num))
  8. return print(lst)
  9.  
  10. def countLower(lst, v):
  11. lower = 0
  12. for i in lst:
  13. if v > i:
  14. lower += 1
  15. return print("Existem {} valores menores do que 'v': ".format(lower))
  16.  
  17. def minmax(lst):
  18. minimo = maximo = lst[0]
  19. for i in lst[1:]:
  20. if i < minimo:
  21. minimo = i
  22. elif i > maximo:
  23. maximo = i
  24. return print("Mínimo é {} e o máximo é {}".format(minimo, maximo))
  25.  
  26.  
  27. lst = []
  28. lista()
  29. v = float(input("Valor de v: "))
  30. countLower(lst, v)
  31. minmax(lst)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement