这是我的解决办法。不雅观。请帮忙。你知道吗
def calculateHandlen(hand):
"""
Returns the length (number of letters) in the current hand.
hand: dictionary (string int)
returns: integer
"""
num = 0
keyS = hand.keys()
for key in keyS:
if hand[key] > 0:
num += hand[key]
return num
Tags:
但为什么呢?你知道吗
相关问题 更多 >
编程相关推荐