在python
考虑以下示例:
The output excludes the starting float (0.5) because the step size is an integer (1.5).To retrieve a range of floats, you can employ one of the following approaches:>>> range(0.5, 5, 1.5)
[0, 1, 2, 3, 4]
此方法通过将每个整数划分为10.0。 lambda function和map():映射(lambda x:x / 10.0,range(5,50,15))
此方法将lambda函数结合在一起。 lambda函数将范围内的每个整数通过将其除以10.0。免责声明: 提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发到邮箱:[email protected] 我们会第一时间内为您处理。
Copyright© 2022 湘ICP备2022001581号-3