Guest User

Untitled

a guest
Dec 17th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. resp = 'S'
  2. soma = quant = média = maior = menor = 0
  3. while resp in 'Ss':
  4. núm = int(input("Digite um número: "))
  5. soma += núm
  6. quant += 1
  7. if quant == 1:
  8. maior = menor = núm
  9. else:
  10. if núm > maior:
  11. maior = núm
  12. if núm < menor:
  13. menor = núm
  14. resp = str(input("Quer continuar? [S/N]: ")).upper().strip()[0]
  15. média = soma / quant
  16. print("Você digitou {} números e a média foi {}".format(quant, média))
  17. print("O maior valor foi {} e o menor foi {}".format(maior, menor))
Add Comment
Please, Sign In to add comment