Advertisement
Guest User

Untitled

a guest
Sep 25th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. import string
  2.  
  3.  
  4. def populate_list(initial_list):
  5.  
  6. while True:
  7.  
  8.  
  9. value = input("Enter value to be added to list: ")
  10. if value.lower() == "exit":
  11. return initial_list
  12. initial_list.append(value)
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23. def triple_list(initial_list):
  24. new_list = initial_list * 3
  25. return new_list
  26.  
  27.  
  28.  
  29. initial_list = []
  30. populate_list(initial_list)
  31.  
  32. new_list = triple_list(initial_list)
  33.  
  34. for items in new_list:
  35.  
  36. print(items)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement