擅长:python、mysql、java
<p>谢谢各位,这是一个很好的帮助(抱歉,我是Python新手)。我认为让这两个输入语句发挥作用是主要问题,但我认为这应该可以解决我的问题:</p>
<pre><code>weather = input("Is is currently raining today? ")
if weather == "yes":
print("You should take the bus to work.")
elif weather == "no":
x = int(input("How far in km do you live from work? "))
if x < 2:
print("You should walk to work.")
if x >10:
print("You should catch the bus to work.")
elif x >=2 and x <= 10:
print("You should ride your bike to work.")
</code></pre>