Bev > On Oct 28, 2019, at 8:42 AM, ferzan saglam <ferzan...@gmail.com> wrote: > > How can I stop this code when -1 is typed or at a maximum item count of ten. > At the moment the code seems to be in a infinite loop meaning it keeps on > asking for an entry until -1 is typed > > > total = 0 > while True: > > print('Cost of item') > > item = input() > > if item != -1: > total = total + item > if item == -1: > > break > > print(total) -- https://mail.python.org/mailman/listinfo/python-list
- (New to Python) Shopping List Code ferzan saglam
- Re: (New to Python) Shopping List Code Bev In TX
- Re: (New to Python) Shopping List Code Bev In TX
- Re: (New to Python) Shopping List Code Peter J. Holzer
- Re: (New to Python) Shopping List Code Andrea D'Amore