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
- Host: GitHub
- URL: https://github.com/rogerisk/python-lists-and-dictionaries
- Owner: RogerIsk
- Created: 2024-06-14T14:57:31.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-14T15:03:03.000Z (about 2 years ago)
- Last Synced: 2025-01-17T08:46:07.637Z (over 1 year ago)
- Language: Python
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README-2.md
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
```