當談到python時,我仍然很新,所以對我來說很簡單。每當我測試這個代碼時,它會返回「None」而不是輸入的輸入。任何想法爲什麼會發生?Python Noob:輸入沒有返回
def inputLandValue():
while(1):
try:
value=int(input('Please enter the value of the property '))
break
except:
print('Please enter a whole number (10000)')
return value
def main():
while(1):
landValue = inputLandValue()
print(landValue)
doMoreStuff = input('Do you want to continue? y/n ')
if(doMoreStuff.lower() != 'y'):
break
main()
input()
我想給其他+1的寵物小精靈參考! – Loufylouf