lundi 20 avril 2020

create list when if == ok in python

I want to add value in list if I the status is "select" but it overwrite the value in list with the last value

if status == 'select':
    object_name = input("Enter a name for the tracked object:")
    Ax = x - w/2
    Ay = y - h/2
    p1 = (object_name,Ax,Ay)
    list = []
    list.append(p1)
    print(list)
    print(len(list))

Aucun commentaire:

Enregistrer un commentaire