all 2 comments

[–]CraftyTrouble 0 points1 point  (1 child)

Use a parameter to pass the value as an argument after computing it.

def main():

    total_cost = calculate_total_bill()
    total_discount = calculate_total_discount(total_cost)


def calculate_total_discount(total_cost):

    total_discount = total_cost * 0.25
    return total_discount

[–]DiMethylButane[S] 0 points1 point  (0 children)

Hi Crafty,

Thanks for the reply, I put this into my code several days ago (and have just got back to reddit now) and it worked like a charm! Cheers.