0
我是一個新手程序員,但我通常可以發現這樣的事情,所以我想它是一個邏輯錯誤,而不是語法之一。所以我想知道你是否可以用你的眼睛來糾正錯誤。代碼是:不會離開while循環
database = open("database.txt", "r+")
databaselist = database.readlines()
length = len(databaselist)
for i in range (length):
database.readline()
Continue = True
while Continue == True:
Title = input("Enter title of book: ")
Author = input("Enter author of book: ")
Genre = input("Enter genre of book: ")
Location = input("Enter the location of the book: ")
TitleWrite = Title + "\n"
AuthorWrite = Author + "\n"
GenreWrite = Genre + "\n"
LocationWrite = Location + "\n"
database.write(str(TitleWrite))
database.write(str(AuthorWrite))
database.write(str(GenreWrite))
database.write(str(LocationWrite))
Continue2 = input("Would you like to continue? Y or N: ")
if Continue2 == "n":
Contine = False
database.close()
Contine - >繼續 – PascalVKooten
錯字'Contine'是一個不同於'Continue'的參數 – CoryKramer