daily pastebin goal
37%
SHARE
TWEET

Untitled

a guest Feb 16th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. entrada = input().split()
  2. tot = []
  3. c = 0
  4. if not entrada:
  5.     print("Nenhum produto foi comprado!!!")
  6.  
  7. while entrada:
  8.     a = float(entrada[0])
  9.     b = float(entrada[1])
  10.     maior = menor = float(b)
  11.     if b >= maior:
  12.         b = maior
  13.     if b <= menor:
  14.         b = menor
  15.     c += 1
  16.     tot.append(a*b)
  17.     entrada = input().split()
  18.  
  19. print(f"Item de Menor Preco: {menor:.2f}")
  20. print(f"Item de Maior Preco: {maior:.2f}")
  21. print(f"Itens Comprados: {c}")
  22. print(f"Total Gasto: {sum(tot):.2f}")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top