Can someone explain why when I run this it asks for input 2 times when I say to create another save file? I'm using python 3.9.1 on a mac with default python IDLE.
Here is my code:
import pickle
names = []
count = 0
times = 1
a = "false"
gameplayfunc = "false"
while (count < 9):
for i in range(times):
names.append(input('Please enter save file name: '))
x = input("Would you like to create another save file?")
if x == "Yes" or x == "yes" or x == "YES":
names[i]
pickle.dump( x, open( names[i], "wb" ) )
times = times + 1
a == "true"
elif x == "No" or x == "no" or x == "NO":
namee = names[i] + json
pickle.dump( x, open( namee, "wb" ) )
gameplayfunc = "true"
count = 10
while a == "true":
count = 10
count = 1
a == "false"
...
for i in range(times):
print(names[i])