"Python programming from entry to practice" (Chapter III. List Brief) Notes

  1. The value of the delete elements
    motocycles = [ 'Hoda', 'yamaha', 'Suzuki']
    motocycles.remove ( 'YAMAHA') to delete the motocycles 'yamaha', the list if there are multiple 'yamaha', remove () You can only delete the first one.

  2. Sort () method to sort the list permanently; function sorted () to sort the list by temporary

Published 12 original articles · won praise 0 · Views 1884

Guess you like

Origin blog.csdn.net/qq_38122800/article/details/104104411