In many cases we should never reason out the right solution of a problem; we lack the data.

Durant Drake, North American ethics researcher

Appendix 2Solutions to Single-Star Projects

This appendix provides sample solutions to select (single-star) projects. The suggested solutions are implemented in the most “Pythonic” way. If your own solutions are different, don’t get desperate! Just like there is always more than one way to write about love and death, there is always more than one way to solve a programming problem.

Hello, World!

Write a program that outputs “Hello, World!” (less the quotes) on the Python command line (original problem here).

 # Honor the tradition
 print​(​"Hello, World!"​)
Word Frequency Counter

Write ...

Get Data Science Essentials in Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.