dimanche 28 janvier 2018

How to take a list of strings randomly select one, and change it

I have this list in python, in each has a integer,

listofarea=[a1,a2,a3,a4,a5]

I need to take one then change one... but when I do,

area=random.choice(listofarea)

All you get is the number. hich means I can change the number but I cant change the string so...

if it picked a2 I would just get,

231

but I need it to say,

a2

Thanks in advance, O1lec1




Aucun commentaire:

Enregistrer un commentaire