Motivation
Was working on a HackerRank challenge and I found myself wondering what the cleanest solution should look like. F-strings!
Example problem
Given the list of scores: [10, 20, 30]
, give the average value correct to 2 decimal places.
The solution
This solution should work for any list containing integers regardless of length.
1 | scores = [10, 20, 30] |
Neat, right?