Hi I'm new to programming, i have a program that will count name start from 1 to the range of a data. My problem is the counter will continue to add the previous name. For example, when i run file 1 , it will show a,b,c , but when i run the second file the name will start from d,e,f. What i want is to reset the counter value to A whenever i choose a new file.
My code
num = 0
def countname():
global num
num += 1
return str(num)
def change():
for content in data2:
filename = "" + "Name" + " " + countname()
print(filename)