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.


from flask import Flask

app = Flask(__name__)

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
Chris Freeman
Treehouse Moderator 68,423 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!!