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
  • 112,593
  • 23
  • 157
  • 280
HARSHIT BAJPAI
  • 192
  • 1
  • 13

0 Answers0