Python_Lab16.py - #CPSC#Lab 16 def replaceword(list1 target...

This preview shows page 1 out of 1 page.

#CPSC #4/25/2018 #Lab 16 def replaceword(list1, target, replaceWord): for i in range(0, len(list1)): if list1[i] == target: list1[i] = replaceWord print("New list: ", list1) def main(): print("Welcome! Enter your words one at a time and hit enter after each value. When you are done entering values, type 'stop'.") list1 = []

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture