Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

python get list elements missing in one list

list1 = ['1.1.1.1/24', '2.2.2.2/24', '3.3.3.3/24', '4.4.4.4/24']
list2 = ['3.3.3.3/24', '4.4.4.4/24', '5.5.5.5/24', '6.6.6.6/24']

set1 = set(list1)
set2 = set(list2)

missing = list(sorted(set1 - set2))
added = list(sorted(set2 - set1))

print('missing:', missing)
print('added:', added)
Comment

PREVIOUS NEXT
Code Example
Typescript :: typescript import type 
Typescript :: property decorator typescript constructor 
Typescript :: how to compare two lists element by element in python and return matched element 
Typescript :: ts generics 
Typescript :: google chrome keyboard shortcuts windows 
Typescript :: basic variable types typescript 
Typescript :: typescript check type 
Typescript :: stripe create customer 
Typescript :: property does not exist on type any typescript 
Typescript :: how to send attachments to node mailer file not found 
Typescript :: typescript datetimte 
Typescript :: how to use a loop for each elements in mongo db 
Typescript :: typescript array of string array 
Typescript :: serenity remove toolbar dialog 
Typescript :: error TS2531 
Typescript :: Fill in the right keywords to test the conditions: 
Typescript :: typescript catch error type 
Typescript :: filter typescript 
Typescript :: typescript compare types 
Typescript :: typescript foreach async await 
Typescript :: how to add enchantments to mobs plugin 
Typescript :: typescript pick 
Typescript :: fit_transform() takes 2 positional arguments but 3 were given 
Typescript :: type async function typescript 
Typescript :: setTimeout without arguments 
Typescript :: generator typescript 
Typescript :: slice string into segments of 2 characters 
Typescript :: How does a consumer commit offsets in Kafka? it directly commit the offset in Zookeeper it directly send a message to the __consumer_offset it interact with the Group coordinator None 
Typescript :: sort even dont exists meta wordpress 
Typescript :: typescript "variable?: type" notation 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =