I am having an equality issue. The following code compares the nested lists to the list dice.
def largeStraight(dice):
straightValues = [{1, 2, 3, 4, 5}, {2, 3, 4, 5, 6}]
return any(value.issubset(dice) for value in straightValues)
def smallStraight(dice):
straightValues = [{1, 2, 3, 4}, {2, 3, 4, 5} , {3 ,4, 5, 6}]
return any(value.issubset(dice) for value in straightValues)
def giveResult(dice):
score = 0
if(largeStraight):
score = 40
elif(smallStraight):
score = 30
else:
score = 0
return score
dice = [1,2,3,4,1]
print(giveResult(dice))
This should return a value of 30 from giveResult, however I am getting a score of 40.
largeStraight(dice)andsmallStraight(dice). You aren't passing dice, but instead are evaluating truthiness of a function, which is True.