Python
Python学习之路
Sheeber
这个作者很懒,什么都没留下…
展开
-
Python 第二课 1
>>> 2+2 4 >>> 2+4 6 >>> 4+ 3 7 >>> 2.0 + 1 3.0 >>> 3.000 + 5 8.0 >>> 15/7 2.142857142857143 >>> 50 - (5 + 5) SyntaxError: unexpected indent >>> 50 - (5 + 5) 40 >>> 2 * (5 +原创 2020-06-15 23:20:06 · 115 阅读 · 0 评论 -
Python 特性
Some programming-language features of Python are: A variety of basic data types are available: numbers (floating point, complex, and unlimited-length long integers), strings (both ASCII and Unicode), lists, and dictionaries. Python supports object-orie原创 2020-06-11 21:50:22 · 225 阅读 · 0 评论 -
Python 第一课 2
第一课拓展: 由于引入turtle库,实现画线功能。 原因:在idle中进行程序编写,太过麻烦,如果编写出错或没有实现想要的效果就需要重复写代码 结果:创建python脚本进行编辑,然后运行脚本,则可省去大量工作。 步骤: 1、打开notepad++,把扩展命修改为.py 2、在脚本中撰写代码 3、运行脚本 打开idle,在菜单栏,点击File,选择Open… ,选择创建的脚本,则可打开。 4、在idle中菜单栏中选择Run, 再选Run Module,弹出python shell,然后输入main(原创 2020-06-11 21:45:59 · 213 阅读 · 0 评论 -
Python 第一课
在Idle中输入以下代码: #turtle是python中绘制图像的库, 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(原创 2020-06-07 21:42:40 · 168 阅读 · 0 评论