0

I'm writing a statistics program which will maintain a list of float values. The program will implement the following menu:

  1. Add value to list

  2. Delete value from list (by value)

  3. Delete value from list (by location in list)

  4. Display list

  5. Exit

I've written everything except the third option. I can't figure out how to get it done. How would one do that?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Kjc21793
  • 79
  • 1
  • 2
  • 13

1 Answers1

0

In Python you can delete an item from a list by referencing it. Like this:

del list[location]
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Hans Then
  • 10,935
  • 3
  • 32
  • 51