I am working on a program for my mum's work and trying to set a variable such as col = 6
then after finishing the loop adding to it to make col = 7
in the way col = col + 1
and keeping it that way. However, I cannot make it stick and it always reverts back to being col = 6
.
first = input("What would you like to do; view, add or edit? ").lower()
if first == 'view':
print(allcells)
if first == 'add':
add = input("What would you like to add; pupil or development? ").lower()
if add == 'pupil':
col = 6
surname = input("Please input surname ").lower()
sheet.update_cell(col, 1, surname)
col = col + 1
print (col)
I would like col
to change from 6 to 7 after running it, then furthermore to 8,9,10 etc. and for it to stay as I close and run the file over and over.