Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Programa \n")
- def lista():
- while True:
- num = input("Número: ")
- if num == "":
- break
- lst.append(float(num))
- return print(lst)
- def countLower(lst, v):
- lower = 0
- for i in lst:
- if v > i:
- lower += 1
- return print("Existem {} valores menores do que 'v': ".format(lower))
- def minmax(lst):
- minimo = maximo = lst[0]
- for i in lst[1:]:
- if i < minimo:
- minimo = i
- elif i > maximo:
- maximo = i
- return print("Mínimo é {} e o máximo é {}".format(minimo, maximo))
- lst = []
- lista()
- v = float(input("Valor de v: "))
- countLower(lst, v)
- minmax(lst)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement