Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Otec Perez Glass](https://uploads.teamtreehouse.com/production/profile-photos/10404572/micro_Foto_de_Perfil.jpg)
Otec Perez Glass
7,678 PointsNeed help!
Challenge 2
Question
Add a new route to multiply() that has two arguments. Add the same two arguments to the multiply() view. They should have defaults of 5.
I'm not sure what is the BUG in this code
ERROR MESSAGE
Bummer: Didn't get a 200 at /multiply
from flask import Flask
app = Flask(__name__)
@app.route('/multiply')
@app.route('/multiplication/<num1>/<num2>')
def multiply(num1 = 5, num2 = 5):
return "{}".format(num1*num2)
![Otec Perez Glass](https://uploads.teamtreehouse.com/production/profile-photos/10404572/micro_Foto_de_Perfil.jpg)
Otec Perez Glass
7,678 PointsIlse Ackerman hope you are doing well and Thank you
def multiply(num1 = 5, num2 = 5):
return "{}".format(num1*num2)
But sitll the error message
2 Answers
![KRIS NIKOLAISEN](https://secure.gravatar.com/avatar/65d74a723997b41a80d2d909c6e06960?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
KRIS NIKOLAISEN
54,969 PointsYour route should be multiply instead of multiplication. I was able to get past task 2 with the following:
@app.route('/multiply')
@app.route('/multiply/<num1>/<num2>')
def multiply(num1 = 5, num2 = 5):
return "{}".format(5*5)
![Otec Perez Glass](https://uploads.teamtreehouse.com/production/profile-photos/10404572/micro_Foto_de_Perfil.jpg)
Otec Perez Glass
7,678 PointsKRIS NIKOLAISEN THNANK you were very helpful!
![Daniel Smith](https://secure.gravatar.com/avatar/7e9e13edc5de12ebd9e026d0434910cb?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Daniel Smith
10,172 Pointswhy does this work with .format(5*5) but not .format(num1*num2)?
![Victor Warner](https://uploads.teamtreehouse.com/production/profile-photos/10925324/micro_virtual_self.jpg)
Victor Warner
2,869 Points.format(num1*num2) does work I believe the user has to create a completely new route for this challenge to work
Ilse Ackerman
3,511 PointsIlse Ackerman
3,511 PointsHi Otec! I don't know if this will resolve the issue, but I do spy a typo. (
.fomat
instead of.format
)