私は現在python-jabberbotをいじっていて、ランダムな文を送信する簡単なメソッドを作成するのに問題があります。私はPythonに堪能ではないので、どこが間違っているのか疑問に思っています。配列を宣言する方法が私の没落であると感じています:
def whatdoyouknow(self, mess, args):
"""random response"""
string[0] = 'this is a longish sentence about things'
string[1] = 'this is a longish sentence about things number 2'
string[2] = 'this is a longish sentence about things number 3'
i = random.randint(0, 2)
return string[i]