Answers for "how to check if all values in list are equal python"

1

how to check if all values in list are equal python

res = all(ele == lst[0] for ele in lst)
      
    if(res):
        print("Equal")
Posted by: Guest on April-16-2021
0

how to check if all values in list are equal python

if len(lst) < 0 :
        res = True
    res = lst.count(lst[0]) == len(lst)
      
    if(res):
        print("Equal")
Posted by: Guest on April-16-2021

Code answers related to "how to check if all values in list are equal python"

Python Answers by Framework

Browse Popular Code Answers by Language