0

For example, If I have an list -

a = [10,2,3,5,17]

I want to tell python that I don't want the element 17 anymore and I want to remove that element and decrease the size of the array by 1.

I know python automatically frees all objects that are not referenced anymore, but how do I tell python that I don't want to use the last index anymore?

I basically want to make my program more memory efficient and remove all the extra space that I don't want dynamically.

martineau
  • 119,623
  • 25
  • 170
  • 301
HARSHIT BAJPAI
  • 361
  • 2
  • 17

0 Answers0