简介
在编程中,经常需要将一个数字限制在某个范围内。这就是 clamping(钳位)概念发挥作用的地方。钳位一个数字意味着将其限制在某个值范围内。在这个挑战中,你将负责创建一个函数,该函数能将一个数字钳位在指定范围内。
Skills Graph
%%%%{init: {'theme':'neutral'}}%%%%
flowchart RL
python(("Python")) -.-> python/FunctionsGroup(["Functions"])
python(("Python")) -.-> python/BasicConceptsGroup(["Basic Concepts"])
python(("Python")) -.-> python/DataStructuresGroup(["Data Structures"])
python/BasicConceptsGroup -.-> python/comments("Comments")
python/DataStructuresGroup -.-> python/tuples("Tuples")
python/FunctionsGroup -.-> python/function_definition("Function Definition")
python/FunctionsGroup -.-> python/build_in_functions("Build-in Functions")
subgraph Lab Skills
python/comments -.-> lab-13602{{"在范围内钳位数字"}}
python/tuples -.-> lab-13602{{"在范围内钳位数字"}}
python/function_definition -.-> lab-13602{{"在范围内钳位数字"}}
python/build_in_functions -.-> lab-13602{{"在范围内钳位数字"}}
end