I am trying to use object orientation to create a game. I want to be able to access rooms and run activities but only be able to run certain activities in each room. I have all the activities assigned to a Object and I want to use the variable that the player typed in to access the Objects' variables then print what they did in the room.
if activitiesList[i] == choice2:
convert = (activitiesList2[i + 1])
convert = str(convert)
print ('You', a.convert, 'in', a.name)
Convert gets the name of the activity from the list then I want it to tell the Object which variable it's looking for. Everything I have tried just results in the program looking for the attribute 'convert' in the Object. How do i get it to search for the attribute that the player chose?