私がこのように書いたこの関数:
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 シェル (関数は .py ファイルから取得されます) で実行すると、タプルではなく int オブジェクトが返されます! 私は何を間違っていますか?単一の int オブジェクトではなく、値のペアを変換しようとしています。