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 trialAbdulmohsen Alkulaibi
323 Pointscorrect route for multiplier
i get the following error when running the code: "Bummer: Didn't get a 200 at /multiply"
The route includes empty URL and the multiply URL, so why am I getting the error?
thanks
from flask import Flask
app = Flask(__name__)
@app.route('/')
@app.route('/multiply/<int:n>/<int:m>')
def multiply():
return " {} * {} = {}".format(5,5,5*5)
1 Answer
John Lack-Wilson
8,181 PointsThis is because the challenge expects you to use the exact route "/multiply" and no others. If you remove the @app.route('/') and also the '/<int:n>/<int:m>' then you're off to a good start.
Secondly, the challenge is asking you to specifically calculate 5 * 5. Hint there is no need to use variables here.