我是初学者,有编程和Python.
我想要做的是阅读并遵循书中的例子,例如"学习Python困难之路"和"Hello world:计算机程序设计为孩子和其他人".
我希望能够在我乘坐公共汽车和火车时在我的android(xperia arc)手机上做示例问题.火车穿过隧道,所以这需要在没有互联网的情况下工作.这意味着repl.it和ideone将不起作用(我认为).
到目前为止,我已经安装了SL4A脚本层(我想 - 不知道如何检查以确保它正常工作)并且我安装了P4A(python for android).我还需要什么才能获得终端/ shell窗口?
我在最后一行 - 第14行遇到了语法错误.我看不出原因,因为它似乎是一个简单的打印语句.
cel = "c"
far = "f"
cdegrees = 0
fdegrees = 0
temp_system = input ("Convert to Celsius or Fahrenheit?")
if temp_system == cel:
cdegrees = input ("How many degrees Fahrenheit to convert to Celsius?")
output = 5/9 * (fdegrees - 32)
print "That's " + output + " degrees Celsius!"
elif temp_system == far:
fdegrees = input ("How many degrees Celsius to convert to Fahrenheit?")
output = (32 - 5/9) / cdegrees
print "That's " + …
Run Code Online (Sandbox Code Playgroud)