Advertisement
PedroPauloFO

Lanche Mais Pedido

Jun 30th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. # coding: utf-8
  2. # Pedro Paulo, 114110482, 30/06/2014
  3. #Lanche Mais Pedido
  4.  
  5. def lanchemaispedido(pedidos):
  6.     verifica_aumento = 1
  7.     for lanche in pedido:
  8.         quant_este_lanche = 0
  9.         lanche_a_checar = lanche
  10.         for lanche in pedido:
  11.             if lanche_a_checar == lanche:
  12.                 quant_este_lanche += 1
  13.             print quant_este_lanche
  14.         verifica_aumento = quant_este_lanche
  15.         if quant_este_lanche > verifica_aumento:
  16.             maispedido = lanche
  17.         else:
  18.             maispedido = "None"
  19.     return maispedido
  20.    
  21. pedido = raw_input().split()
  22.  
  23. lanche_mais_pedido = lanchemaispedido(pedido)
  24.  
  25. print pedido
  26. print "O lanche mais pedido desse cliente foi %s" % lanche_mais_pedido
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement