Python Flask Basics Welcome to Flask Multiply View

non 200 response at /multiply

although I added the route, i seem to be getting the following error : "non 200 response at /multiply"

flask_app.py
from flask import Flask

app = Flask(__name__)

@app.route('/')
@app.route('/multiply/<int:n>/<int:m>')
def multiply():
    return " {} * {} = {}".format(n,m,n*m)

1 Answer

John Lack-Wilson
John Lack-Wilson
8,164 Points

There is no need to include the @app.route('/') route, as the challenge is only asking for the multiply route.

Also, the declaration for the multiply route should not include any parameters (i.e. @app.route('/multiply') should be the declaration)

Finally, the challenge is asking you to return the string of 5*5, so there is no need to use variables here, you can simply return str(5*5)