docs: 2026-04-21作业

This commit is contained in:
2026-04-27 22:12:44 +08:00
parent b0db5b3239
commit dd21ddbaef
7 changed files with 139 additions and 0 deletions

View 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>