mardi 15 décembre 2020

I want to return to "input" after type wrong character in python

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

_WriteList = input("Write a textfile with the file list? (Enter) Yes or (n) No: ")

if bool(_WriteList) == False:
    sevenZipListWrite()
elif _WriteList == "n":
    sevenZipList()

Aucun commentaire:

Enregistrer un commentaire