Guest User

Untitled

a guest
Oct 18th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. if len(external_api.fetch_list()) > 10:
  2. raise Exception("Error")
  3. highest_price = 0
  4. for i in external_api.fetch_list():
  5. if i['price'] > highest_price:
  6. highest_price = i['price']
  7. print('Highest price: ' + highest_price)
  8. # display stats
  9. for i in external_api.fetch_list():
  10. print('full_name ' + i['details']['full_name'])
  11. print('release_date ' + i['details']['release_date'])
  12. print('rating ' + i['details']['rating'])
  13. low_ratings = []
  14. for i in external_api.fetch_list():
  15. if i.rating < 3:
  16. low_ratings.append(i['details']['rating'])
  17. low_ratings.sort()
  18. print('Num low ratings: ' + len(low_ratings))
  19. print('Lowest rating: ' + low_ratings[0])
  20. for i in external_api.fetch_list():
  21. for j in external_api.fetch_list():
  22. if i['id'] != j['id'] and i['name'] == j['name']:
  23. print('duplicate ' + i['name'])
Add Comment
Please, Sign In to add comment