Advertisement
Mochinov

Untitled

Nov 18th, 2020
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. new_list = [14, 15, 16, 17]
  2. old_list = [17, 20]
  3.  
  4. print(new_list)
  5. print(old_list)
  6. print('===========')
  7. del_val = []
  8. set_val = []
  9. for i in old_list:
  10.     if i in new_list:
  11.         pass
  12.     else:
  13.         del_val.append(i)
  14. for i in new_list:
  15.     if i in old_list:
  16.         pass
  17.     else:
  18.         set_val.append(i)
  19.  
  20. print(del_val)
  21. print(set_val)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement