2017-12-11 4 views
2
end = False 
numbers = [] 
while not end: 
i =(raw_input(" Enter the number(0 to end the input)")) 
if i ==0: 
    end = True 
else: 
    numbers.append(i) 
print numbers 

リストは、ユーザによる入力が入力された場合でも、終了していないユーザーによって入力された場合でも、印刷は、あなたの文字列として代わりに番号を取得0一覧</p> <p>0 ..を

答えて

3

あり続けます

if int(i) == 0 

かのように、あなたの入力を取得、これを試してみてください整数に変換または整数

としてそれを取得しよう、

i =(input(" Enter the number(0 to end the input)"))