An open API service indexing awesome lists of open source software.

https://github.com/rogerisk/python-lists-and-dictionaries

Python tasks that concentrates on working with lists and dictionaries
https://github.com/rogerisk/python-lists-and-dictionaries

Last synced: 3 months ago
JSON representation

Python tasks that concentrates on working with lists and dictionaries

Awesome Lists containing this project

README

          

# Task - Top 3 books

You have a dict with a list of book titles as keys and their sales numbers as values. Implement a method that prints the top 3 books from this dict to the screen.

## Input:

```python
books = {
'Harry Potter And The Sorcerer\'s Stone': 1241100000,
'Harry Potter And The Chamber Of Secrets': 771300000,
'Harry Potter And The Prisoner Of Azkaban': 65210000,
'Harry Potter And The Goblet Of Fire': 645600000,
'Harry Potter And The Order Of The Phoenix': 635600000,
'Harry Potter And The Half Blood Prince': 661300000,
'Harry Potter And The Deathly Hallows ': 652200000,
}
```

## Output:

```
1.Harry Potter And The Sorcerer's Stone: 1241100000
2.Harry Potter And The Deathly Hallows : 652200000
3.Harry Potter And The Goblet Of Fire: 645600000
```