Guest User

Untitled

a guest
May 17th, 2020
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. # Формируем словарь {процент: [список цен за него]}
  2. def get_prices_dict(bids):
  3.     prices_dict = {}
  4.  
  5.     for bid in bids:
  6.         try:
  7.             for percent in bid.keys():
  8.                 try:
  9.                     percent_price = bid[percent]["Price"]
  10.                     if percent in prices_dict:
  11.                         prices_dict[percent].append(percent_price)
  12.                     else:
  13.                         prices_dict[percent] = [percent_price]
  14.                 except:
  15.                     pass
  16.         except:
  17.             pass
  18.     return prices_dict
Add Comment
Please, Sign In to add comment