@app.route('/categories/<int:category_id>/products')
def show_products_of_category(category_id):
category = Category.query.get_or_404(category_id)
products = category.products
return render_template('shop.html', category=category, products=products)
<source lang="python">
def more_or_less_one(number: int) -> str:
# write your code here
n = str(number)
a = "JUMPING"
b = "NOT JUMPING"
res = []
new_list = []
for i in range(0, len(n), 1):
res.append(int(n[i: i + 1]))
for x in range(len(res)-1):
if abs(res[x] - res[x + 1]) != 1:
new_list.append(b)
else:
new_list.append(a)
if b in new_list:
print(b)
else:
print(a)
</source>