docs: 2026-04-21作业
This commit is contained in:
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>
|
||||
Reference in New Issue
Block a user