Get startedGet started for free

Countries of affiliation

We saw in the last exercise that countries can be associated with a laureate as their country of birth and as their country of death. For each prize a laureate received, they may also have been affiliated with an institution at the time, located in a country.

This exercise is part of the course

Introduction to MongoDB in Python

View Course

Exercise instructions

  • Determine the number of distinct countries recorded as part of an affiliation for laureates' prizes. Save this as count.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# The number of distinct countries of laureate affiliation for prizes
count = ____(db.laureates.____(____))
print(count)
Edit and Run Code