Question from the Python test

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

Hard

What does this code do ?

import collections
scores = collections.defaultdict(int)
scores['Al'] += 1
scores['Zophie']
Author: El MehdiStatus: PublishedQuestion passed 178 times
Edit
0
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...