(Python)关于下面的问题,选项(A)和选项(C)有什么区别?

(Python) Regarding the following question, what's the difference between Option (A) & Option (C)?

我在上在线课程时遇到了这个问题。正确答案是选项(C),但是为什么我不能选择选项(A)呢?这两个选项之间的细微差别是什么?

---> 假设我们想要创建一个 class PolarBearDrunk,一只喝醉了的北极熊,它沿着 x 轴和 y 轴随机移动,向南移动时步幅较大,向北移动时步幅较小。

class PolarBearDrunk(Drunk):
    def takeStep(self):
        # code for takeStep()

以下哪项是 takeStep() 的合适实现?

选项 A)

directionList = [(0.0, 1.0), (1.0, 0.0), (-1.0, 0.0), (0.0, -1.0)]
myDirection = random.choice(directionList)
if myDirection[0] == 0.0:
    return myDirection + (0.0, -0.5)
return myDirection

选项 B)

directionList = [(0.0, 0.5), (1.0, -0.5), (-1.0, -0.5), (0.0, -1.5)]
return random.choice(directionList)

选项 C)

directionList = [(0.0, 0.5), (1.0, 0.0), (-1.0, 0.0), (0.0, -1.5)]
return random.choice(directionList)

选项 D)

directionList = [(0.0, 1.0), (1.0, 0.0), (-1.0, 0.0), (0.0, -1.0), (0.0, -1.0)]
return random.choice(directionList)

+ 元组运算符(如选项 A)表示连接:

(0.0, 1.0) + (0.0, -0.5) == (0.0, 1.0, 0.0, -0.5)