Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我看来,我需要能够以 0.5 的增量生成数字 0-5(因此,0、0.5、1、1.5 等)。有没有办法用树枝的for循环开箱即用?
for
基于树枝文档中的示例二您应该能够做到
{% for i in range(0, 5, 0.5) %} {{ i }}, {% endfor %}