mardi 28 novembre 2017

hello! I need help i cant find out how to count repeated value

there is my code ... I need to find out how many times was element inputted (repeated)

    y=[]
    while True:
       x=input("element: ")
       x=x.strip()
       y.append(x)
       for t in range(len(y)-1):
           if x==y[t]:
             del y[-1]
           print("this element has been inputted" +count+"times")
           print(y)
</code>

Aucun commentaire:

Enregistrer un commentaire