Hi! I have a habit of overthinking things so if there is a better way to do this please let me know. I’m working on a MadLibs game and I want to give the user the option of choosing from a list of MadLibs. I’m putting each MadLib in a function inside of a class.
I’m still learning all the terminology but would it be possible to take the user’s choice as a variable and then just slot it into the class? Part of the reason I’m posting this is because I don’t know what questions to ask to try and google how to do this? Also I feel like this might be the incorrect way to achieve this.
As an example.
class MadLib: def name_of_individual_madlib(self): print("blah blah blah") user_choice = input("Which madlib would you like to do?") MadLib.user_choice()
I’d include if statements to make sure that user choice matches one of the selections. Thanks for reading and any help or suggestions on how to approach this would be appreciated.