I want to return true if all the values in dict for different keys is same else false:
for example:
this should return true:
{1: [1, 1, 1], 2: [1, 1, 1], 3: [1, 1, 1]})
this should return false.
{1: [1, 1, 1], 2: [1, 1, 1], 3: [1, 2, 1]})
I tried the following but it didnt work.
# for i in range(len(votes_grid[0])):
# isTie = any(v == i for v in columnTable.values())
#also tried
isTie = all(v == i for v in columnTable.values())
question from:
https://stackoverflow.com/questions/66056590/check-if-all-the-values-for-different-keys-are-the-same 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…