【发布时间】:2014-05-20 09:27:42
【问题描述】:
我是一个新手程序员,但我通常可以发现这样的事情,所以我认为这是一个逻辑错误而不是语法错误。所以我想知道你是否可以用你的新眼睛来修复错误。代码是:
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是与Continue不同的参数
标签: python debugging python-3.x error-handling