eclipse_360百科
http://baike.so.com/doc/2137168-2261267.html
PyCharm_360百科
http://baike.so.com/doc/6084210-6297312.html
Python入门_Python入门教程_python入门视频教程-慕课网
http://www.imooc.com/learn/177
python进阶_python进阶教程_python进阶视频教程-慕课网
http://www.imooc.com/learn/317
Python 环境搭建 | 菜鸟教程
http://www.runoob.com/python/python-install.html
老王python:http://www.cnpythoner.com/
求平均值
#求平均值
num1 = input("The first number is")
num2 = input("The second number is")
avg_num = (float(num1) + float(num2)) / 2
print("The average number is %f" % avg_num)
温度转换公式
#TempConvert.py
val = input("请输入带温度表示符号的温度值(例如:32C):")
if val[-1] in ['C','c']:
f = 1.8*float(val[0:-1]) + 32
print("转换后的温度为: %.2fF"%f)
elif val[-1] in ['F','f']:
c = (float(val[0:-1]) - 32)/ 1.8
print("转换后的温度为: %.2fc"%c)
else:
print("输入有误")
蟒蛇程序模板
import turtle
def drawSnake(rad,angle,len,neckrad):
for i in range(len):
turtle.circle(rad,angle)
turtle.circle(-rad,angle)
turtle.circle(rad,angle/2)
turtle.fd(rad)
turtle.circle(neckrad+1,180)
turtle.fd(rad*2/3)
def main():
turtle.setup(1300,800,0,0)
pythonsize = 30
turtle.pensize(pythonsize)
turtle.pencolor("blue")
turtle.seth(-40)
drawSnake(40,80,5,pythonsize/2)
main()