Python Flask Basics Welcome to Flask Multiply View

correct 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

flask_app.py
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
John Lack-Wilson
8,164 Points

This 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.