Changes

Jump to: navigation, search

OPS435 Python Lab 3

32 bytes removed, 11:02, 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)'''<dd><dl>The above function takes a single argument which is a list name itself. It will then look at the value of the last existing item in the list, it will then append a new value that is one unit bigger (i.e. '''+1''' and modifying that same list without returning any value).</dl></dd>
:::*The script should have a function called '''remove_items_from_list(my_list, items_to_remove)''' :::*T:::*The <dd><dl>This function '''remove_items_from_list(my_list, list_of_numbers_to_remove)''' takes two arguments, : a list, and a list of numbers to remove from the list. This function will then check if those items are in the exist within that list, and if they are it exist, then they will remove thembe removed. This function modifies will modify the list without returning any value.</dl></dd>
:::'''Sample Run 1:'''<source>
13,420
edits

Navigation menu