Guest User

Untitled

a guest
Sep 24th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. import random
  2.  
  3. def problem_1():
  4. a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
  5. b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
  6. c = []
  7. for n in b: c.append(n)
  8. for n in a:
  9. if n not in b: c.append(n)
  10. print(c)
  11.  
  12. def problem_2():
  13. a = random.sample(range(1,11),5)
  14. b = random.sample(range(1,11),5)
  15. c = []
  16. for n in b: c.append(n)
  17. for n in a:
  18. if n not in b: c.append(n)
  19. print(c)
  20.  
  21. def main():
  22. problem_1()
  23. problem_2()
  24. main()
Add Comment
Please, Sign In to add comment