I am new to programming and would like to practice by creating a small app, using Python. The app asks the user to enter a level and a term and the app will return the curriculum for the said level and term.
I have tried before without using classes and only using nested dictionaries but it got really messy really quick as some classes have a different curriculum.
How could I check if the users input is inside an instance then return the instance attributes in which it contains?
Thanks!
class PacketClasses:
def __init__(self, level, term, song, story, act1, act2):
self.level = level
self.term = term
self.song = song
self.story = story
self.act1 = act1
self.ac2 = act2
class HeadWayClasses:
def __init__(self, level, term, song, review, expression, gs):
self.level = level
self.term = term
self.song = song
self.review = review
self.expression = expression
self.gs = gs
p1 = Packet("Pink", 1, "heads shoulders knees and toes", "The giant grass-hopper", "bowling", "craft")
p2 = Packet("Pink", 2, "ABC song", "The giant grass-hopper part 2", "shopping", "craft")
g1 = Packet("Green", 1, "ABC song", "Snow White", "Animals", "craft")
g2 = Packet("Green", 2, "ABC song", "Snow White part 2", "At the zoo", "craft")
o1 = HeadWay("Orange", 1, "song 1", "review 1", "expression 1", "gs 1")
o2 = HeadWay("Orange", 2, "song 2", "review 2", "expression 2", "gs 2")
a1 = HeadWay("Aqua", 2, "song 1", "review 1", "expression 1", "gs 1")
a2 = HeadWay("Aqua", 2, "song 2", "review 2", "expression 2", "gs 2")
users_level = input("Please enter the level you wish to check: ")
users_term = int(input("Please enter the term level you wish to check: "))
# if users_level & users_term in a class, print the curriculum