Question · Python course · Module 5: Flask and Web Apps

Int type converter

How do you enforce that the 'id' parameter is of type int in Flask?

Answer options

  • @app.route('/species/<id:int>')
  • @app.route('/species/<int:id>')
  • @app.route('/species/<id>/int')
  • @app.route('/species/int/<id>')

You can check the correct answer by solving this task in the CodeWorlds game.