1
単語を入力すると、exceptブロックのコードは実行されません。
それは言う:UnboundLocalError:割り当て
前に参照のローカル変数「アイテム」ここに私のコードです:UnboundLocalError:代入前に参照されるローカル変数 'items' - Python3
def inputSome():
gundam = []
try:
items = int(input("How many items you want to input? \n"))
except ValueError:
print("Input a number literal not words u stupid!, you input {}".format(items))
inputSome()
while len(gundam) < items:
userIn = input("Input some: ")
gundam.append(userIn)
print("You input: {}".format(userIn))
print(gundam)
input_again = input("Want to input again? [Y/N] ")
if input_again.lower() != 'n':
inputSome()
else:
print("See ya sucka!")
inputSome()