我这样写的这个函数:
def simulate_turn(num_rolls, score, opponent_score):
"""This function takes in two scores and a number of die rolls and returns
what the two scores would be if num_rolls many dice were rolled. This takes
into account the swine swap, free bacon, and hog-wild."""
x = score
y = opponent_score
x += take_turn(num_rolls,opponent_score,select_dice(score,opponent_score))
if ifwillswap(x,y):
swap(x,y)
return x,y
在交互式 python shell 中运行时(函数来自 .py 文件),它返回一个 int 对象而不是一个元组!我究竟做错了什么?我试图让它变成一对值,而不是单个 int 对象。