Returns - Question About Functions

Currently working on this and I am slightly confused with Question #4
https://www.codecademy.com/courses/learn-python-3/lessons/intro-to-functions/exercises/returns

Now that we have an expense to subtract, create a new variable called new_budget_after_shirt and set it to be the function call of deduct_expense().

Pass our current_budget variable as the first argument and the shirt_expense variable as the second argument.

My code was

new_budget_after_shirt = def deduct_expense(current_budget,shirt_expense):

but the solution is telling me the correct code is

new_budget_after_shirt = deduct_expense( current_budget, shirt_expense )

Just wondering why the function doesn’t require **def** or **:** in this case as well as needing spaces for the arguements in the parentheses? Can’t seem to find a definitive answer on this.

Did you mean to write y instead of x?

Yes, it should be y


You use def when you declare/define a function, but not where you call it (use it)
y = 3
z = triple(y)  # no def here (triple function called)
print(z)  # no def here either 
1 Like