docs: 2026-04-21作业
This commit is contained in:
11
2026-04-21/templates/2026-04-21_hw_1.html
Normal file
11
2026-04-21/templates/2026-04-21_hw_1.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Homework</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello Flask!</h1>
|
||||
<h2>info: {{info[3]}}</h2>
|
||||
</body>
|
||||
</html>
|
||||
23
2026-04-21/templates/2026-04-21_hw_2.html
Normal file
23
2026-04-21/templates/2026-04-21_hw_2.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Homework</title>
|
||||
</head>
|
||||
<body>
|
||||
{#返回变量num的绝对值#}
|
||||
<h4>绝对值:{{ num|abs }}</h4>
|
||||
{#将变量num转换为整型#}
|
||||
<h4>转换为整型:{{ num|int }}</h4>
|
||||
{#返回变量li中随机的一个元素#}
|
||||
<h4>获取随机元素:{{ li|random }}</h4>
|
||||
{#返回变量li的长度#}
|
||||
<h4>获取列表长度:{{ li|length }}</h4>
|
||||
<h4>列表排序:{{ li|sort }}</h4>
|
||||
<h4>首字母大写: {{ string|capitalize }}</h4>
|
||||
<h4>字母全大写: {{ string|upper }}</h4>
|
||||
<h4>字符拼接: {{ string|join("-") }}</h4>
|
||||
<h4>列表: {{ li }}</h4>
|
||||
<h4>列表排序:{{ li|reverse }}</h4>
|
||||
</body>
|
||||
</html>
|
||||
59
2026-04-21/templates/2026-04-21_hw_3.html
Normal file
59
2026-04-21/templates/2026-04-21_hw_3.html
Normal file
@@ -0,0 +1,59 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
.score{
|
||||
width: 12em;
|
||||
height: 4em;
|
||||
line-height: 4em;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
border: 2px solid black;
|
||||
border-radius: 0.5em;
|
||||
}
|
||||
|
||||
.excellent{
|
||||
background-color: purple;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.lhz{
|
||||
background-color: greenyellow;
|
||||
}
|
||||
|
||||
.middle{
|
||||
background-color: yellow;
|
||||
}
|
||||
|
||||
._60{
|
||||
background-color: orange;
|
||||
}
|
||||
|
||||
._59{
|
||||
background-color: red;
|
||||
}
|
||||
|
||||
.worse {
|
||||
background-color: red;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{% if score >= 90 %}
|
||||
<div class="score excellent">优秀</div>
|
||||
{% elif 80 <= score < 90 %}
|
||||
<div class="score lhz">良好</div>
|
||||
{% elif 70 <= score < 80 %}
|
||||
<div class="score middle">中等</div>
|
||||
{% elif 60 <= score < 70 %}
|
||||
<div class="score _60">及格</div>
|
||||
{% elif 59 <= score < 60 %}
|
||||
<div class="score _59">恭喜你,差点就及格了</div>
|
||||
{% else %}
|
||||
<div class="score worse">不及格</div>
|
||||
{% endif %}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user