I just started learning about classes mostly by reading here https://pythonprogramming.net/classes-python-3-basics-tutorial/
I also am trying to play with branching between classes but for some reason when I get to the result class I get an error that cost is not defined.. Can someone please tell me what i am doing wrong please?
class calculator():
def money(self):
print("What was the cost?")
cost = input("> ")
diners.amount_of_diners()
class diners():
def amount_of_diners():
print("How many people are with you?")
diners = input("> ")
precent.precent_to_give()
class precent():
def precent_to_give():
print("How much '%' you want to give the waiter? ")
prec = input("> ")
result.the_end()
class result():
def the_end():
print("The total amount of money each of you need have to give is: ",cost * diners)
calc = calculator()
calc.money()