Python超ド初心者です(>_<)
Python
1while 1: 2 3 4 terget = input("terget is >>>") 5 6 buy_list = [] 7 8 buy_list.append(terget) 9 10 if not terget: 11 print("さよなら") 12 break 13 14 print(buy_list) 15
これで、buy_listにtergetの要素を、たくさん追加しようと思ったのですが、やるたびにbuy_listが初期化されます。何かいい方法はないでしょうか。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/08/29 12:29