## Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

### Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

# Task 5 of 5: Multiply 5*5. I have clearly defined num1 but continue to get an error...

"Bummer: NameError: name 'num1' is not defined"

```from flask import Flask

@app.route('/multiply')
@app.route('/multiply/<int:num1>/<int:num2>')
@app.route('/multiply/<float:num1>/<int:num2>')
@app.route('/multiply/<int:num1>/<float:num2>')
@app.route('/multiply/<float:num1>/<float:num2>')
def multiply(num1=5,num2=5,product=num1*num2):
return '{} * {} = {}'.format(num1, num2, product)
```

```def multiply(num1 = 5, num2 = 5):
product = num1 * num2
return '{}'.format(product)
``` Oh yeah you right! It has to return only the product and not the whole mathematical formula. Sorry lol I corrected your code but didn't read the challenge.

You can even drop the product variable and make it shorter.

```def multiply(num1 = 5, num2 = 5):
return f'{num1 * num2}'
```

Anthony, thats pretty cool.

The lone 'f' allows you to perform a mathematical formula within the curly brackets I presume?

```return f'{num1 * num2}'
``` I don't think you can multiply local variable in there. (Maybe, I just don't know how?) If it's inside the function it works:

```def multiply(num1=5,num2=5):
product = num1 * num2
return '{} * {} = {}'.format(num1, num2, product)
```

The way I understand it's that the arguments don't exist outside the scope of the body of the function cause if you use global variables it works:

```a = 5
b = 5
def multiply(num1=5,num2=5, product = a * a):
return '{} * {} = {}'.format(num1, num2, product)
```

Hey Anthony C., I think the question may be looking for something else because I'm still getting error messages...

'Bummer: Didn't get the expected response. Got 5 * 5 = 25.'

The quiz is telling us here that it doesn't want '5 * 5 = 25' as an answer. What solution could it be looking for?

```def multiply(num1 = 5, num2 = 5):
product = num1 * num2
return '{} * {} = {}'.format(num1, num2, product)
```