-1
我試圖讓這個程序接受1到1000之間的數字。我錯過了什麼?程序不接受任何用戶輸入
def main ():
getGuestCnt ()
def getGuestCnt ():
guests = input("Please enter the number of guests: ")
while guests != isValidGuest (guests):
print ("Invalid! Enter only positive whole numbers.")
guests = input ("Please enter the number of guests: ")
return int(guests)
def isValidGuest (guests):
return ((str(guests).isdigit()) and (int(guests) >= 0 and int(guests) <= 1000))
main ()