random 随机浮点数 格式 random() 简介 在0到1之间获取一个随机浮点数。 返回值 名称 类型 描述 float float 返回的浮点数 实例 打印一个0到1之间的随机浮点数。 import random print(random.random())