Practice: Templating

💡 This is your chance to put what you’ve learned into action.

Try solving these practice challenges to check that you understand the concepts.

Submission

To log your practice for credit:

Submit on Gradescope

  • Practice exercises will be graded for completion not correctness. You have to document that you did the work, but we won't be checking if you got it right.
  • You are encouraged to engage with all the exercises listed on the practice page.
  • You are expected to submit only the details requested on the Gradescope submission.

Flask FizzBuzz

Practice your Jinja templating by creating a FizzBuzz app in Flask.

Here are the requirements:

  • The app should have one route, /fizzbuzz, that renders an HTML template.
  • In the template, loop through the numbers 1 to 100 inside of an unordered list.
  • For every number that is divisible by 3, show a list element with the word 'Fizz'
  • For every number that is divisible by 5, show a list element with the word 'Buzz'
  • For every number that is divisible by both 3 and 5, show a list element with 'FizzBuzz'
  • For every other number, show a list element with the number