Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 3

7 bytes removed, 11:52, 3 June 2017
PART 3 - Iterating Over Lists
:::*The list '''my_list''' should have the values: '''1, 2, 3, 4, 5'''
:::*The script should have a function called '''add_item_to_list(my_list)'''<ul><libr>&nbsp;This function takes a single argument which is a list name itself. This function will look at the value of the last item in the list, it will then append a new value that is one unit bigger (i.e. '''+1''') than the previous existing list item (element). This function modifies the list without returning any value.</li></ul>
:::*The script should have a function called '''remove_items_from_list(my_list, items_to_remove)'''
:::*T
13,420
edits