Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if len(external_api.fetch_list()) > 10:
- raise Exception("Error")
-
- highest_price = 0
- for i in external_api.fetch_list():
- if i['price'] > highest_price:
- highest_price = i['price']
-
- print('Highest price: ' + highest_price)
-
- # display stats
- for i in external_api.fetch_list():
- print('full_name ' + i['details']['full_name'])
- print('release_date ' + i['details']['release_date'])
- print('rating ' + i['details']['rating'])
-
- low_ratings = []
- for i in external_api.fetch_list():
- if i.rating < 3:
- low_ratings.append(i['details']['rating'])
-
- low_ratings.sort()
- print('Num low ratings: ' + len(low_ratings))
- print('Lowest rating: ' + low_ratings[0])
-
- for i in external_api.fetch_list():
- for j in external_api.fetch_list():
- if i['id'] != j['id'] and i['name'] == j['name']:
- print('duplicate ' + i['name'])
Add Comment
Please, Sign In to add comment