Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Add missing persons
#python 3.5.2 #python 3.5.2 # List of strings my_list = ['john', 'james', 'joey'] # List of dictionaries results = [{"name": 'john', "age": 20}, {"name": 'james', "age": 25}] for name in my_list: found = False; for person in results: if person["name"] == name: found = True if not found: new_person = { 'name': name, 'age': 30 } results.append(new_person); print(results)
run
|
edit
|
history
|
help
0
Greatest Common Factor (Euclidean algorithm, aka Euclid's algorithm)
Inheritance.py
DuckTyping.py
PyRegLookBehind
calculate the sum of string 201test70de88qa ( only numbers)
Hello world
Ozan Taşdemir 9/B 499
PyRegChars
pyFoodTipFoodOrder
Singleton Design in Python