![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python学习
枫影缘
这个作者很懒,什么都没留下…
展开
-
datawhale python Day1
python初体验:print and input 1.1 print:向屏幕输出括号中的内容 print(‘hello world’) #向屏幕输出‘hello world’(注意单引号或者双引号都可以) 1.2 input:函数input() 让程序暂停运行,等待用户输入一些文本。获取用户输入后,Python将其存储在一个变量中。 name=input('please enter...原创 2019-01-26 13:30:05 · 230 阅读 · 3 评论 -
datawhale Python Day6
综述:今天将学习函数。函数是带名字的代码块,用于完成具体工作。要执行函数定义的特定任务,可调用该函数。需要在程序中多次执行一项任务时,我们无需反复编写该任务的代码,而只需调用执行该任务的函数即可。通过使用函数,程序的编写、阅读、测试和修复都将更加容易。 1.1 定义函数 示例1:打印问候语 def greet_user(): print('Hello!') greet_user() #输...原创 2019-01-31 21:54:31 · 169 阅读 · 2 评论 -
datawhale Python Day7
作业:画小猪佩奇 import turtle as t t.pensize(4) # 设置画笔的大小 t.colormode(255) # 设置GBK颜色范围为0-255 t.color((255,155,192),"pink") # 设置画笔颜色和填充颜色(pink) t.setup(840,500) # 设置主窗口的大小为840*500 t.speed(10) # 设置画笔速度为10...原创 2019-02-01 18:34:36 · 151 阅读 · 0 评论 -
datawhale python Day3
字典(dict) 1.1 概念: 在Python中,字典是一系列键—值对。每个键都与一个值相关联,你可以使用键来访问与之相关联的值。与键相关联的值可以是数字、字符串、列表乃至字典。 在Python中,字典用放在花括号{}中的一系列键—值对表示。 student_0={'name':'mike','points‘:90}# 这个字典存储了有关student_0 的信息,具体地说是这个学生的信息。...原创 2019-01-28 21:06:32 · 184 阅读 · 0 评论 -
datawhale Python Day5
1.datetime模块 1.1 datetime.date.today() #返回当前日期 import datetime print(datetime.date.today()) #输出结果: 2019-01-30 1.2 datetime.date #创建自定义日期,注意:个位数的月和日前面不要加‘0’ import datetime d = datetime.date(2016,7,24...原创 2019-01-30 20:54:21 · 349 阅读 · 1 评论