Python program to remove negative elements from a list.#pythonprogram #listProgram

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

this is really simple. just looping through an array list and checking if an interger is smaller than zero is so, remove i (number in list)

blinx
Автор

List comprehension is cleaner imo.
[x for x in list if x >= 0]
Or use numpy

justinmoore
Автор

but it can't remove element less than -10 like -9, -8

mayank
Автор

This works but there is a faster way to code this

aaravbhatt