if I have a list for eg numbers = [78, 89, 56] how do I use conditionals to determine whether the number 81 is larger than all the numbers in the list?
I'd use a list comprehension to generate a list of booleans representing whether 81 is larger than each element or not, and then apply all
to it:
>>> numbers = [78, 89, 56]
>>> all ([81 > x for x in numbers])
False
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments