python - 学习python卡在项目上
问题描述
我是自学编程(python) 我给了自己一个项目来编写 Beaufort 量表。我这样做了,见下文,但每次我输入风速时,我都会得到所有可能的答案,而不是我编程给我的答案。谁能告诉我我的方式错误。
wind_speed = (input("What is the wind speed? "))
if wind_speed <= "3":
print("light airs drifting conditions")
if wind_speed > "3" <= '6':
print("Light breeze, sail: full sail and large genoa.")
if wind_speed > "7" <= "10":
print("Gentle breeze, sail: full sail")
if wind_speed > "11" <= "16":
print("Moderate, Sail: reduce headsail size")
if wind_speed > "17" <= '21':
print("Fresh breeze,sail: reef mainsail")
if wind_speed > '22' <= '27':
print("Strong breeze,sail:reef main sail and reduce headsail")
if wind_speed > '28' <= '33':
print("Near gale, sail: deep reefed main sail, small jib")
if wind_speed > '34' <= '40':
print("Gale, sail: deep reefed main, small jib")
if wind_speed > '41' <= '47':
print("Severe gale, sail: trysail and storm jib")
if wind_speed > '48' <= '55':
print("Storm,survival conditions")
else:
print("SKillz")
解决方案
推荐阅读
- reactjs - ASP.NET Core 项目 React 中的 ES6 模板文字(模板字符串)
- c# - 将类型传递给c#中的函数
- aws-lambda - 在 Lambda 上运行时,Winston CloudWatch 传输未创建日志
- c# - com(ocx)如何使用c#运行时加载
- scripting - EB 指南(com. ed 6.8)脚本引擎报告“预期 'Function () void' 但得到 '错误'
- spring-boot - 如何使用 Gradle + Spring boot 运行多个配置文件?
- python - 为什么使用 __new__ 时无法访问类变量?
- javascript - 正则表达式将特定模式与数字匹配。允许的数字 0 和大于 5
- android - 发布失败(69);尝试在 https://pub.dartlang.org 中查找 cupertino_icons 的套接字错误
- flutter - ValueListenableBuilder:监听多个值