while True:
try:
continue_shopping=int(input("press 0 to stop shopping and print your reciept or press 1 to continue shopping"))
if continue_shopping !=0 and continue_shopping !=1:
print(" make sure you enter 0 or 1")
if continue_shopping !=1
keep_searching = False
if (continue_shopping == 0):
fileOne.close()
fileTwo = open("receipt.csv" , "r")
reader = csv.reader(fileTwo)
for row in reader:
if row != None:
print(row)
elif continue_shopping==1:
search_user_input()
quantity()
quantity()
5行目に無効な構文エラー赤で強調表示された「場合」、私はこれがあなたが忘れてしまった場合
あなたが忘れてしまった「:」条件 – N0un
の終わりにあなたは、構文エラーの次に 'てみ-if'句 –
を使用することはできません:Pythonは、適切なインデントを必要とします。 try:ブロック内のすべてのコードには、任意のインデントが必要です。 keep_searching = Falseです。 – RvdK