Quick actions

cmd+k|ctrl+k

Navigation

Languages

List Comprehension (2)

Snippet info

Language

Python

Visibility

public

Author

hilmi-am

Created

2020-06-23T14:28:44Z

Updated

2020-06-23T14:28:44Z

list_x = [1, 2, 3, 4, 5]
list_y = [2, 7, 3, 9, 10]
common_nums = [x for x in list_x for y in list_y if x == y ]
print(common_nums)
INFO