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

Karl Berg
Karl Berg
493 Points

There are multiple ways of obtaining the answer but you're forcing one specific. Clearly a waste of time!

A fully acceptable solution (amongst many others?).

@app.route('/multiply/<float:n1>/<float:n2>') @app.route('/multiply/<float:n1>/<int:n2>') @app.route('/multiply/<int:n1>/<float:n2>') @app.route('/multiply/<int:n1>/<int:n2>') def multiply(n1=5,n2=5): return '{} + {} = {}'.format(n1,n2,n1 + n2)

very frustrating!

1 Answer

Josh Keenan
Josh Keenan
19,652 Points

This is the answer they wanted:

def multiply(): 
  return str(5 * 5)

The challenge wants you to multiply the two numbers together and return the result in the format of a string, you returned 5 + 5 instead, this is simply the wrong answer!

Post again if you need any more help in understanding this or with further parts of the challenge!