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

Python Flask Basics Welcome to Flask Multiply View

What am i doing wrong? I can get it to work outside of the treehouse environment.

https://teamtreehouse.com/library/flask-basics/welcome-to-flask/multiply-view

flask_app.py
from flask import Flask

app = Flask(__name__)

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

[MOD: correct link -cf]

Please copy and paste here what you need to do because it does not let me access the link.

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,454 Points

There are a few errors to correct:

  • keep the route from Task 1 unchanged. add a second route for task two.
  • in the /multiply route, default values are needed for num1 and num2. Add this in the function parameter list.
  • the challenge asks only to return the value of the multiply as a string. Do not include the equation in the string.

Post back if you need more hints. Good luck!!