-4
有人可以幫我解決這個錯誤嗎?Python 3 IF語句
quantity = int(input('enter the the quantity:'))
if quantity>=10 and quantity<=19:
print('20% off')
discount=99*0.2
print('discount ', discount)
purchase= quantity*99-dicount
print('purchase is ', purchase)
它說線5 IndentationError:預期的縮進塊
Python中的分化非常重要。您必須縮進代碼才能將其放置在「if」循環中。 – Ffisegydd 2014-09-19 09:04:51
這意味着:IndentationError:預計會出現一個縮進塊 – bereal 2014-09-19 09:05:36
請在提問之前進行自己的研究。只要用錯誤信息搜索就會導致數以千計的教程,文章和文章描述問題,原因和解決方案。此外,在對SO進行提問之前,您應該對所編程的語言有最低限度的理解 - 事實上,您不知道Python的基本知識(控制流由縮進處理)意味着您缺少這個最低限度的理解,並且在問任何進一步的問題之前應該閱讀一些教程或書籍。 – l4mpi 2014-09-19 09:14:24