Advertisement
Vikis

two list

Nov 14th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. import random
  2.  
  3. list1 = random.simple(range(1,7))
  4. list2 = random.simple(range(1,6))
  5.  
  6. print("input list1: {}".format(list1))
  7. print("input list2: {}".format(list2))
  8.  
  9.     for i in range(1, len(list1)):
  10.     for j in range(1,len(list2)):
  11.     list3 = []
  12.  
  13.     while i < len(list1) and j < len(list2):
  14.     if list[i] == list[j]
  15.      list3.append(list1)
  16.      j += 1
  17.      else
  18.      i +=1
  19.      print("input list3: {}". format(list3) )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement