こんにちは、私はpythonプログラムに取り組んでいますが、ユーザーに数値を入力するように再プロンプトするはずのループからエラーが返され続けています。私が抱えている問題は、他の関数で行う必要がある操作に使用できない nonetype を返し続けることです。ありがとう。
(これが私のコードです。正しくフォーマットされていない場合は、事前に申し訳ありません。)
def getTickets(limit):
ticketSold=int(input("How many tickets were sold? "))
if (ticketsValid(ticketSold,limit)):
return ticketSold
else:
getTickets(limit)
#This function checks to make sure that the sold tickets are within the Limit of seats
def ticketsValid(sold,limit):
if (sold>limit or sold<0):
print ("ERROR: There must be tickets less than "+str(limit)+" and more than 0")
return False
return True
# This function calculates the price of the tickets sold in the section.
def calcIncome(ticketSold,price):
return ticketSold*(price)