Learn practical skills, build real-world projects, and advance your career
colors=["red","green","blue","orange","cyan","indigo"]
[c for c in colors if c[0] in "aeiou"]
['orange', 'indigo']
hero=["ironman","thor","spiderman"]
{h:len(h) for h in hero}
{'ironman': 7, 'thor': 4, 'spiderman': 9}
grocery={"milk":2.9,"butter":1.5,"bread":3.2}
{g:grocery[g]*70 for g in grocery}
{'milk': 203.0, 'butter': 105.0, 'bread': 224.0}
grocery.items()
dict_items([('milk', 2.9), ('butter', 1.5), ('bread', 3.2)])
for k,v in grocery.items():
    print(k,v)
milk 2.9 butter 1.5 bread 3.2