Comment utiliser la compréhension du dictionnaire pour faire un dictionnaire pour certains noms d'une liste dans Python
names = ["David", "Sarah", "Matt"]
# it makes name as key and Doctor as value for each name in list names
career = {name:"Doctor" for name in names}
print(career)
#output >>> {'David': 'Doctor', 'Sarah': 'Doctor', 'Matt': 'Doctor'}
Inquisitive Ibex