Is This an Average Puzzle? Yes!

Daily Data Science Puzzle

import numpy as np

# Goals in five matches
goals_brazil = np.array(
goals_germany = np.array(

br = np.average(goals_brazil)
ge = np.average(goals_germany)

What is the output of this puzzle?
*Beginner Level*

Numpy is a popular Python library for data science focusing on arrays, vectors, and matrices.

This puzzle introduces one new feature of the numpy library: the average function. When applied to a 1D numpy array, this function returns the average value of the numpy array.

In the puzzle, the average of the goals of the last five games of Brazil is 1.8 and of Germany is 0.8. On average, Brazil shot one more goal per game.

Are you a master coder?
Test your skills now!

Related Video




Leave a Comment

Your email address will not be published. Required fields are marked *