Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python any() function

# All elements of tuple are true
t = (2, 4, 6)
print(any(t))
 
# All elements of tuple are false
t = (0, False, False)
print(any(t))
 
# Some elements of tuple are true while
# others are false
t = (5, 0, 3, 1, False)
print(any(t))
 
# Empty tuple
t = ()
print(any(t))
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #Python #function
ADD COMMENT
Topic
Name
4+9 =