-1
この機能を使用するには問題があります。その目的は、リストから項目を削除することです。リストから項目を削除する際に問題が発生する
def sell(inventory_list):
print()
count = int(input('How many items would you like to sell? '))
print()
for count in range(count):
print()
type = input('Enter the type of item you wish to sell? ')
print()
name = input('Enter the name of the item you wish to sell? ')
print()
price = float(input('What is the price of the item you wish to sell? $'))
items = Plant.SubPlant(type, name, price)
inventory_list.remove(items)
return inventory_list
'inventory_list.remove(項目)は'あなたが返す可変オブジェクトを、変異します。どのくらい正確にこの関数を呼び出していますか? – TigerhawkT3
print()は引数を取るべきです、何を印刷しようとしていますか?あなたはcount変数を再利用しています - おそらく "範囲(count)のxに対して" – flyingmeatball
@flyingmeatballそれは新しい行を表示しています –