【发布时间】:2021-01-18 17:23:49
【问题描述】:
以下是我的示例代码。我需要知道weather 变量的类型,它可能是List、Dictionary 或Tuple。有没有像我们在python中使用type()这样的简单方法?
{% extends 'base.html' %}
{% block title%}
Home
{% endblock %}
{% block content %}
<h3 class="text-center text-success">Weather Forecast!!</h3><hr>
{{weather}}
<hr>
{% for w in weather%}
{{w}}<br/>
{% endfor%}
{% endblock %}
【问题讨论】:
-
这应该可以帮助你...stackoverflow.com/a/12028864/10860596
-
上面的问题还可以,但是答案不满意!!..
标签: python-3.x django django-templates