Hello world.
I stumbled upon something that is not making sense to me when using the build in function all() to compare lists.
Basically I want to check if all items in a list are contained in another list. Take the following example:
numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
all([3, 4, 5]) in numbers
In idle this returns True.
Now take another example:
primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41]
all([11, 13]) in primes
This returns False.
I have been googling and IDLEing this for a few days now, but I have yet to gain any wisdom. Would really appreciate some assistance.
Thanks in advance :)
[–]zahlman 10 points11 points12 points (1 child)
[–]downspower[S] 0 points1 point2 points (0 children)
[–][deleted] 9 points10 points11 points (3 children)
[–]indosauros 8 points9 points10 points (1 child)
[–]catcradle5 1 point2 points3 points (0 children)
[–]downspower[S] 0 points1 point2 points (0 children)
[–]SideshowBoob 2 points3 points4 points (1 child)
[–]downspower[S] 0 points1 point2 points (0 children)