I have the following loop, that I would like an advice on how I express as a dictionary comprehension:
new_dict=dict()
for isbn in old_dict:
if old_dict[isbn]==1:
new_dict[isbn]='Fast'
else:
new_dict[isbn]='Leis'
I have the following loop, that I would like an advice on how I express as a dictionary comprehension:
new_dict=dict()
for isbn in old_dict:
if old_dict[isbn]==1:
new_dict[isbn]='Fast'
else:
new_dict[isbn]='Leis'