I want to return to the “input” after the user type another character that is not “n” string,
The entry data is a “Input” that make the user press enter to continue or type “n”, but if the user type another string, the console close
JavaScript
x
7
1
_WriteList = input("Write a textfile with the file list? (Enter) Yes or (n) No: ")
2
3
if bool(_WriteList) == False:
4
sevenZipListWrite()
5
elif _WriteList == "n":
6
sevenZipList()
7
Advertisement
Answer
You should do it using a while loop like this
JavaScript
1
8
1
_WriteList = input("Write a textfile with the file list? (Enter) Yes or (n) No: ")
2
3
while _WriteList != 'n':
4
sevenZipListWrite()
5
_WriteList = input("Write a textfile with the file list? (Enter) Yes or (n) No: ")
6
7
sevenZipList()
8