samedi 14 mars 2020

how to get a list with all values?

I have a dictionary with lists. input question['yesno'] consists of the list with random numbers. I would like to replace all numerical values with string (iteration is needed probably).

inf = dict()

inf['yesno']=list()
for inf['yesno'] in inf:
    if question['yesno'] is 0:
        inf['yesno']="yes"
    else:
        inf['yesno']="no"

as output I get only the first value. Can you tell me pls how can I get list with all values?

Thanks in advance!

Aucun commentaire:

Enregistrer un commentaire