Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

all python

mydict = {1: "sam", 1 : "john", 1: "loki"}
x = all(mydict)
print(x)

#output: True (because all() checks for keys not the value)

mydict1 = {}
y = all(mydict1)
print(y)

#output: True (even if iterable is empty)
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #python
ADD COMMENT
Topic
Name
3+6 =