0
我想學習Python 3,我不知道我怎麼會循環的東西...Python 3中,需要幫助的東西循環
print("how many cats do you have?")
numCats = input()
try:
if int(numCats) >= 4:
print('That is a lot of cats.')
elif int(numCats) in range(1, 3):
print('That is not that many cats.')
elif int(numCats) == 0:
print("Oh, you have no cats.")
except ValueError:
print('You did not enter a number.')
我想,這樣當它說,使其「你沒有輸入號碼。「它會回到「你有多少貓?」
你擡頭「蟒蛇循環」的循環進行? – AsheKetchum
如果有3只貓,爲什麼不打印任何東西? –