Zanders 214
Zanders 214

Reputation: 39

Trying to increase numbers in lists

So when the input is for example 1, the first 0 in the list is supposed to increase to 1 and when the other output is 1 again the first number in the list which should then be 1 because it changed, should change to 2 but I really don't know how to do it I searched but I couldn't find an answer so please help.

edit: I removed the code that I think you don't need to know for this question so if you need to know something just tell me. These numbers can be chosen for a:1,2,3,4,5,6,7

used = [0,0,0,0,0,0,0]


a = int(input("Choose a column."))
gb = used[a-1]=1
choose_r(a) 
gb


a = int(input("Choose a column."))
choose_g(a)
gb

Upvotes: 2

Views: 210

Answers (1)

I Funball
I Funball

Reputation: 380

Add these lines directly below the second input:

if (1 >= a <= 7): 
    gebruikt[a-1] += 1
else:
    print ("Invalid Index Number")

Upvotes: 2

Related Questions