I have a list of string
[a,b,c]
How do I check if all the variables are the string 'Ready'?.
I want to return True if all variables are Ready
else False.
I really appreciate any help you can provide.
I have a list of string
[a,b,c]
How do I check if all the variables are the string 'Ready'?.
I want to return True if all variables are Ready
else False.
I really appreciate any help you can provide.
You can use all
and a list comprehension:
lst = ['Ready', 'Ready', 'Ready']
print(all(i == 'Ready' for i in lst))
Output:
True
Thanks for @schwobaseggl's comment, you can also do this:
print(all(map("Ready".__eq__, lst)))