I have a class Menu
class Menu:
options = []
label = 'empty'
def __init__(self, label, options):
self.label = label
self.options = options
def __repr__(self):
return '%s \n=====================\n\n%s' % (self.label, self.options[0])
What I am trying to do here is format the repr function so that it prints all the options. Right now it will correctly print
Label
\==============
Option 1
But can I throw a for loop in that return statement, or is there a proper way of fixing this?