![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python学习
suyisure
星光不问赶路者,岁月不负有心人。
展开
-
判断闰年
老方法 year = int(input("请输入一个年份:")) if (year % 4) == 0 and (year % 100) != 0 or (year % 400) == 0: print("{0}是闰年".format(year)) else: print("{0}不是闰年".format(year)) 这个就是很简单,能看懂得方法了,这个是多语句一起用,也可以...原创 2018-12-26 17:34:50 · 167 阅读 · 0 评论 -
判断大小
判断int的大小 任意数字比大小 N = int(input('输入需要对比大小数字的个数:')) print("请输入需要对比的数字:") num = [] for i in range(1,N+1): temp = int(input('输入第 %d 个数字' % i)) num.append (temp) print('您输入的数字为:',num) print('最大值为:...原创 2018-12-26 21:31:14 · 792 阅读 · 0 评论 -
我要努力学Python了
我要努力学Python了 看了差不多一个月的Python,看的时候感觉啥都懂,但是,关掉视频就傻逼了,啥也不知道了。 现在开始,要边看教程边写程序了,而且还要写一些博客来记录自己。 以下是我自己照着视频,写的一些代码(PS:有的代码我经过小幅度的修改) 1.hello world(听说是程序员第一个代码基本上都是它) print("hello world") print("what is your...原创 2018-12-21 15:59:55 · 152 阅读 · 0 评论 -
turtle绘图
turtle(海龟)绘图 直接上代码 #导入turtle的所有 from turtle import * #设置笔刷的宽度 width(4) #前进200个像素点 forward(200) #右转90° right(90) #修改笔刷颜色,注意啦,如果没有定义颜色,默认是黑色的 pencolor('blue') forward(150) right(90) pencolor('green') fo...原创 2018-12-25 17:22:13 · 405 阅读 · 0 评论