有人能帮我调试脚本吗?
嗨,这是一个非常简单的脚本,但由于我是新手,我不知道我做错了什么。另外,如果你可以,我会很感激关于一个好的Python集成开发环境的提示。
选择 | 换行 | 行号
- #!/usr/local/bin/python
- x1 = raw_input("What is x1 ")
- x2 = raw_input("What is x2 ")
- y1 = raw_input("What is y1 ")
- y2 = raw_input("What is y2 ")
- def main():
- choice = raw_input("What type of question are you doing?" ;
- " /n Midpoint = M, Gradient = G and Sides = S")
- print x1
- print x2
- print y1
- print y2
- if choice = "M":
- print "(x1 + x2)/2, (y1 + y2)"
- elif choice = "G":
- print "(y1 - y2)/(x1 - x2)"
- elif choice = "S":
- print "((x1 - y1)**2 + (x2 - y2)**2)**1/2)"
- else:
- print"Sorry, your input was not recognised,";
- print "make sure to use /n capital letters"
- return 0;
谢谢安迪