Lists
def main(): lst = [1,2,3,8,7] fun(lst) print(lst) def fun(mylist): for i in range(len(mylist)): mylist[i] += 10
#function to report the words in a list which are palindromes #assumes you have a function which returns True when its argument is a palindrome def pallist (wordlist): newlist = [] for i in range(len(wordlist)): if palindrome(wordlist[i]): newlist.append(wordlist[i]) return newlist
Arrays in Python slides