I want to get the result() method's variable that is called word.
If someone knows how to do it, please help me.
def result(self,var1,word="",mainlista=mainlista):
try:
for i in range(int(var1)):
x = random.choice(mainlista)
word += x
except IndexError:
pass
try? Nothing in that code can raiseIndexError.xto an instance variable.