저는 파이썬을 처음 접했고 화씨를 섭씨로 변환하고 싶다면 파이썬 프로그램을 만들려고합니다. 여기에 프로그램입니다 :섭씨와 화씨로 변환하기
x = (raw_input("would you like to convert fahrenheit(f) or celsius(c)?"))
if x == "f":
y = (raw_input("what is the fahrenheit?"))
f = (int(y) - 32) * 5.0/9
print f
if x == "c":
n = (raw_input("what is the celsius?"))
z = (int(n) *9)/5 + 32
print "and in fahrenheit, that is:"
print z
나는 elif x == "c"
에 if x == "c"
을 변경했지만, 그것은 나에게 TextError
했다. 어떤 아이디어?
이 항상 "오류"를 인쇄합니다. 'print 'Error "'앞에'else'가 없습니다. – srikanta
감사합니다. @srikanta. Ans가 업데이트되었습니다. – sinhayash
else와 함께 no : 다음은 SyntaxError입니다. 최근에 루아에서 코딩 했습니까? ;) – kampu