bounslay

Untitled

May 20th, 2023
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. # 1 2 3 4 5 7
  2. # 1 2 4 4 5 6
  3.  
  4.  
  5. lst1 = input().split()
  6. lst2 = input().split()
  7.  
  8.  
  9. while len(lst1) != len(lst2):
  10.     if len(lst1) > len(lst2):
  11.         lst2.append('x')
  12.    
  13.     elif len(lst2) > len(lst1):
  14.         lst1.append('x')
  15.  
  16.  
  17. for i in range(len(lst1)):
  18.     for j in range(len(lst2)):
  19.  
  20.         if lst1[i] == lst2[j]:
  21.             print('+', lst1[i], lst2[j])
  22.             lst2.remove(lst2[j])
  23.             break
  24.         else:
  25.             print('-', lst1[i], lst2[j])
  26.             lst2.remove(lst2[j])
  27.             break
Advertisement
Add Comment
Please, Sign In to add comment