|
@@ -28,14 +28,14 @@ Quick start
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
- from pywebio.input import input
|
|
|
+ from pywebio.input import input, FLOAT
|
|
|
from pywebio.output import put_text
|
|
|
|
|
|
def bmi():
|
|
|
- height = input("请输入你的身高(cm):")
|
|
|
- weight = input("请输入你的体重(kg):")
|
|
|
+ height = input("请输入你的身高(cm):", type=FLOAT)
|
|
|
+ weight = input("请输入你的体重(kg):", type=FLOAT)
|
|
|
|
|
|
- BMI = float(weight) / (float(height) / 100) ** 2
|
|
|
+ BMI = weight / (height / 100) ** 2
|
|
|
|
|
|
top_status = [(14.9, '极瘦'), (18.4, '偏瘦'),
|
|
|
(22.9, '正常'), (27.5, '过重'),
|
|
@@ -98,4 +98,4 @@ Quick start
|
|
|
Document
|
|
|
------------
|
|
|
|
|
|
-使用手册和开发文档见 `https://pywebio.readthedocs.io <https://pywebio.readthedocs.io>`_
|
|
|
+使用手册和实现文档见 `https://pywebio.readthedocs.io <https://pywebio.readthedocs.io>`_
|