Guest User

Untitled

a guest
Jul 16th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. import random
  2.  
  3. def one(lenght):
  4. a = []
  5. for i in range(length):
  6. a.append(1)
  7. return(a)
  8.  
  9. def two(parent):
  10. b = parent
  11. if random.randint(0,10)<11:
  12. index = random.randint(0,6)
  13. b[index] = 6
  14. return
  15.  
  16. item1 = one(6)
  17. print(item1)
  18. item2 = item1
  19. print(item2)
  20. item3 = two(item1)
  21. print(item2)
  22.  
  23. [1,1,1,1,1,1]
  24.  
  25. [1,1,1,1,1,1]
  26.  
  27. [1,6,1,1,1,1]
Add Comment
Please, Sign In to add comment