![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 63
奋斗的小鸟鸟
You’ll never realize how strong you are until you have no other choice but to be strong<br>你永远都不会知道自己到底有多坚强,直到有一天你除了坚强别无选择。
展开
-
python基础知识(三)
1.函数 (def)def顺序:位置 > *arge > 默认值 > **kwargs (*arge 和**kwargs是默认参数)<1>动态传参def footst(*foot): # *表示位置参数的动态传参,*接收到的值会被统一放在一个元组里面 print(foot)footst("面包", "香肠", "饮料", "手抓饼")输出的:('面包', '香肠', '饮料', '手抓饼')<2>第二种动态传参def chu(**fo原创 2022-02-06 12:04:18 · 837 阅读 · 0 评论 -
python基础知识(二)
1.元组: tuple , 特点:不可变得列表, 数据是不可被改变固定某些数据,不让外间修改元组如果只有1个元素(*),需要在元素的末尾添加一个逗号元组也有索引,查的时候就用索引t = ("炸弹", "火箭", "坦克")print(t)输出: ('炸弹', '火箭', '坦克')set() 创建空集合tuple() 创建空元组list() 创建空列表str() 创建空字符串2.set集合,set集合是无序的lp = set()lp.add("我")lp.add(原创 2022-01-24 16:58:13 · 1543 阅读 · 0 评论 -
python基础知识(一)
1. if判断语句mony = input("请输入:")mony = int(mony)if mony > 500: print("我呀回家")else: print("不回家")# 这个是在输入以后来判断是否大于500 2. while 循环语句**打印1-100的数字**i = 1while i <= 100: print(i) i = i + 1<1>.1+2+3+4+5+6+…+100 = ?a = 1原创 2021-12-28 17:30:51 · 679 阅读 · 0 评论