-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpall.py
More file actions
25 lines (21 loc) · 682 Bytes
/
pall.py
File metadata and controls
25 lines (21 loc) · 682 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
def all1(para):
""" THIS FUNCTION WILL RETURN Flase IF ANY ATLEAST 1 OBJECT WILL NOT ITRABLE.
--> OR YOU CAN SAY THAT IF 'Flase' OR 0 PASSED IN PARAMETER OR ANYT LIST, TUPPLE OR DICT OR SET IT WILL RETURN False
OTHERWISE RETURN True. """
if type(para) == list or tuple or set:
if False in para:
return False
return True
if type(para) == dict:
for i in para:
if False in para.keys():
return False
return True
if type(para) == str:
return True
else:
return Exception(f"{type(para)} is not itrable")
# Example
# x = {1, 11, 34, "True"}
# res = all1(x)
# print(res)