Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. #2 seconds
  2. {'lastUpdateId': 202588846, 'store1': [['24.43000000', '0.00606000'], ['24.42000000', '14.76000000'], ['24.39000000', '2.65760000'], ['24.38000000', '29.59867000'], ['24.35000000', '7.71171000']], 'store2': [['24.47000000', '0.22601000'], ['24.52000000', '0.72000000'], ['24.53000000', '3.28839000'], ['24.54000000', '5.63226000'], ['24.55000000', '20.64052000']]}
  3. #2 seconds
  4. {'lastUpdateId': 202588904, 'store1': [['24.45000000', '0.22596000'], ['24.44000000', '12.84000000'], ['24.43000000', '22.43211000'], ['24.42000000', '5.87234000'], ['24.39000000', '2.65760000']], 'store2': [['24.51000000', '0.00003000'], ['24.52000000', '2.80979000'], ['24.53000000', '17.64938000'], ['24.67000000', '3.41000000'], ['24.68000000', '115.07610000']]}
  5.  
  6. import time
  7. def testing():
  8.  
  9. stores = {'lastUpdateId': 202588846, 'store1': [['24.43000000', '0.00606000'], ['24.42000000', '14.76000000'], ['24.39000000', '2.65760000'], ['24.38000000', '29.59867000'], ['24.35000000', '7.71171000']], 'store2': [['24.47000000', '0.22601000'], ['24.52000000', '0.72000000'], ['24.53000000', '3.28839000'], ['24.54000000', '5.63226000'], ['24.55000000', '20.64052000']]}
  10.  
  11. firststore = [i[1] for i in stores['store1']]
  12.  
  13. secondstore = [e[1] for e in stores['store2']]
  14.  
  15. offer1 = float(firststore[0]) + float(firststore[1]) + float(firststore[2])
  16.  
  17.  
  18. offer2 = float(secondstore[0]) + float(secondstore[1]) + float(secondstore[2])
  19.  
  20.  
  21. count = 0
  22.  
  23. if offer1 > offer2:
  24.  
  25. count+=1
  26.  
  27. print("This store has the lesser better deal")
  28.  
  29. if count == 10:
  30. print("go ahead and buy")
  31.  
  32. if offer2 > offer1:
  33. count+=1
  34. print("this other store has the lesser letter deal")
  35.  
  36. if count == 10:
  37. print("go buy this")
  38.  
  39. i = 0
  40. while True:
  41. i+=1
  42. testing()
  43. time.sleep(2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement