The reaction rate of a post

Write code · Medium · §4.2 Updating dictionaries

Add the key comments with the value 12 to the sample post. Store the sum of the likes and the comments in reactions. Divide reactions by the number of views, multiply by 100, and store the result in rate. Print three lines: reactions, then rate with one decimal place and % after it, and then the value of the shares key (or 0 if the key is missing).

Starter code

post = {"author": "yuna", "likes": 180, "views": 2400}

Solve this problem in your browser

Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.