1,234
edits
Changes
→PART 2 - Manipulating Items in Lists
:#In addition to using functions to manipulate lists, there are functions that are useful to provide '''information''' regarding the list such as number of elements in a list, the smallest value and largest value in a list:<source lang="python">
list_of_numbers = [ 1, 5, 2, 6, 8, 5, 10, 2 ]
# Notice how the long line below is wrapped to fit on one screen:
print("List length is " + lengthOfList length_of_list + ", smallest element in the list is " + smallestInList smallest_in_list + ", largest element in the list is " + largestInListlargest_in_list)
</source>