S
S
Showwy2021-12-24 08:14:20
Python
Showwy, 2021-12-24 08:14:20

Why is the code not running?

a=[0, 1, 5, 10, 44, 60, 34, 31, 79, 110, 111] 
a.sort()
while a[-1]%10!=0:
    a=a.pop()
else:
     print (str (a[-1]))

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Kuts, 2021-12-24
@Showwy

And what does a become equal to after this command?
a=a.pop()
and will this code work after that?
while a[-1]%10!=0:

K
Konstantin Nagibovich, 2021-12-24
@nki

The error is on the fifth line.
Do we have to come up with the code ourselves or can you show it to us?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question