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}] unique_names = set((person["name"] for person in results)); for name in set(my_list): if name not in unique_names: new_person = { 'name': name, 'age': 30 } results.append(new_person); print(results)
run
|
edit
|
history
|
help
0
hi
func mast
Python3 - select fruits
gfg pattern
handwash
PySlots3
time module sleep localtime
Faiha - Lesson 8
http
(P2) Ciągi 2 - mapowanie