Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Add missing names
#python 3.5.2 # List of strings my_list = ['john', 'james', 'joey'] # List of dictionaries results = [{"name": 'john', "age": 20}, {"name": 'james', "age": 25}] new_persons = [{"name": name, "age": 30} for name in set(my_list) if name not in set((person["name"] for person in results))]; results.extend(new_persons); print(results)
run
|
edit
|
history
|
help
0
Skillenza - Marker Count
Adivina el número
sensi
shuru3
Hello World Test
metods.py
LinkedList in Python
practice
HW Descending order
Lab_III_3_24_11_2020