Guest User

Untitled

a guest
Jun 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import random
  2.  
  3. array1 = []
  4. array2 = []
  5. newArray = []
  6. size1 = random.randint(1,100)
  7. size2 = random.randint(1,100)
  8. cont = 0
  9. while cont < size1 :
  10. cont = cont + 1
  11. array1.append(random.randint(1,100))
  12. cont = 0
  13. while cont < size2 :
  14. cont = cont + 1
  15. array2.append(random.randint(1,100))
  16. print(array1)
  17. print(array2)
  18.  
  19. for elem in array1:
  20. if elem in array2:
  21. if not elem in newArray:
  22. newArray.append(elem)
  23.  
  24. print (newArray)
Add Comment
Please, Sign In to add comment