- 博客(6)
- 收藏
- 关注
原创 Python 自学笔记 day04 -- 函数
函数生成函数的两种方法定义函数def function(para1, para2)""" # 注释函数功能、参数、结果function: para1:para2:return:""" result = para1 + para2 return result重构函数Refactor >>> Extract Method #将代码重构为函数调取函数import # 调取 from math import factorial as f
2022-04-16 22:00:01
544
原创 Python 自学笔记 day03 -- 数据、运算、输出
数据类型int >>> integer >>> 整型str >>> string >>> 字符串bool >>> boolean >>> 布尔型float >>> 3.14 314e-2>>> 浮点型complex >>> x+yj >>> 复数型格式化输出print('%d + %d = %d' % (a, b
2022-04-14 17:26:35
579
原创 Python 自学笔记 day02 -- 列表、元组、字符串、集合、字典
列表(list)可放不同类型数据,可重复list = [i for i in range(10)] # 生成(推导)式语法构造列表list[index] # 列表的索引运算 <0时倒序取值,返回列表中序数为index的元素list.index(a,b) # 返回序数b之后的a在列表中位置,如果a不存在,程序崩溃,建议提前if预判list.count(a) # 返回a在列表中出现的次数list.append() # 末位追加数据list.insert(0,a)
2022-04-14 17:14:29
372
原创 Python 自学笔记 day01 -- Python环境安装及pycharm快捷键
#1.运行环境下载安装python官方下载地址##python 安装Add Python 3.10 to PATH / checkcustomize installationpip / checkAdd Python to environment variables / checkcustuomize install location / c:\Python310Disable Max depth limit / click###完成验证python --versionpip --v
2022-04-14 17:00:57
520
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人