0
我一直在努力与一个小循环。我不知道为什么我的while
循环不起作用。如果我删除的2个条件它的作品之一,但是当两者都一起它不...while 2条件环
temp = input("Choose between Fahreneit degrees 'f'' key or Celsius degrees 'c' key ")
while temp != "f" or temp != "c" :
temp = input("you must choose f or c")
if (temp == "f") :
print("you choosed Fahreneit")
degF = int(input("What is the temperature outside?"))
print("It seems that the temperature is around" , (0.56 * (degF - 32)) ,"Celsius from your Fahreneit sample")
elif (temp == "c") :
print("you choosed Celsius")
degC = int(input("What is the temperature outside?"))
while degC < -273 or degC > 5500 :
degC = int(input("Please enter a correct value"))
print("it seems that the temperature is around" , (1.8 * (degC) + 32) , "Fahreneit from your Celsius sample")
或者只是:
或跳过完全布尔头痛 “我一直在挣扎了小船尾。” - 经典。 – Ideasthete 2014-09-19 14:34:58
一个空间是不够的 - 为了可读性遵循[风格指南](http://legacy.python.org/dev/peps/pep-0008/#indentation)并缩进四个空格 – jonrsharpe 2014-09-19 14:41:15