Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # b_match_3_in_sublists.py
- main_list = [[3, 4, 5, 6], [3, 1, 4, 2], [1, 0, 4, 2]] # Example main list
- nums = [1, 2, 3] # Numbers to check
- for sublist in main_list:
- if all(num in sublist for num in nums):
- print("--> All numbers [1, 2, 3] are in the sublist", sublist)
- else:
- print("Not all numbers [1, 2, 3] are in the sublist", sublist)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement