What is the output of this code? #Question declined due to community downvotes. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

What is the output of this code? #Question declined due to community downvotes.

What is the output of this code? A = [1,5,5,5,3] for elem in A: if elem == 5: A.remove(5) print (elem)

28th Mar 2017, 5:00 PM
Javier I. Rivera R.
Javier I. Rivera R. - avatar
5 Answers
+ 8
Well if you're wondering why your question got downvotes, it's probably because it's a little difficult for some people. The output is three lines and it is a little misleading. Try editing it and resubmitting it. Another reason might be that someone has already sent in the same question before. The best solution is to send in as many as you can. Happy coding!
28th Mar 2017, 5:04 PM
Caleb Jore
Caleb Jore - avatar
+ 7
Well the output is really three lines and it doesn't return an array, so your question is incorrect. That's probably why it got declined.
28th Mar 2017, 5:12 PM
Caleb Jore
Caleb Jore - avatar
+ 4
Sorry forgot to place the options.. * [1, 5, 3] * [1, 3] * [1, 5, 5] * Error
28th Mar 2017, 5:07 PM
Javier I. Rivera R.
Javier I. Rivera R. - avatar
+ 1
Thanks @Caleb Jore
28th Mar 2017, 5:17 PM
Javier I. Rivera R.
Javier I. Rivera R. - avatar
0
la salida seria 5 5 los elementos que remueve y que entran en el if.
29th Mar 2017, 2:10 PM
Eislen Yeraldin Puentes Barreto
Eislen Yeraldin Puentes Barreto - avatar