(New to Python) Shopping List Code

Andrea D'Amore and.damore at gmail.com
Mon Oct 28 10:28:31 EDT 2019


On Mon, 28 Oct 2019 at 14:42, ferzan saglam <ferzans97 at 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

>     item = input()
>     item != -1:

Try these two in REPL and see how the break condition you are using in
your code is evaluated, then check each of the comparison operands.

-- 
Andrea


More information about the Python-list mailing list