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