Question from the Python test

Create a dictionary with keys 'AI' and 'Zophie' and values 1 and 0 respectively.

Medium

What does this code do ?

import collections
scores = collections.defaultdict(int)
scores['Al'] += 1
scores['Zophie']
Author: El MehdiStatus: PublishedQuestion passed 268 times
Edit
1
Community Evaluations
developer avatar
Other
Auteur anonyme
03/04/2024
Ce ne me semble pas ĂȘtre essentiel de connaĂźtre collections.defaultdict() pour faire du python...