随笔分类 -  python / 学习代码笔记 / day08

03 字符串类型
摘要:# 1、作用# 2、定义# msg='hello' # msg=str('msg')# print(type(msg)) # 3、类型转换# str可以把任意其他类型都转成字符串# res=str({'a':1})# print(res,type(res)) # 4、使用:内置方法# 4.1 优先掌 阅读全文

posted @ 2023-02-27 17:19 小小小传说 阅读(30) 评论(0) 推荐(0)

02 数字类型
摘要:# 一:int类型# 1、作用:# 2、定义:# age = 10 # age=int(10) # 名字(参数)# print('hello','world') # x=int(10)# name=input('xxx')# res=print('xxx') # 没有产品# print(res) # 阅读全文

posted @ 2023-02-27 17:18 小小小传说 阅读(115) 评论(0) 推荐(0)

01 流程控制之for循环
摘要:'''1、什么是for循环 循环就是重复做某件事,for循环是python提供第二种循环机制2、为何要有for循环 理论上for循环能做的事情,while循环都可以做 之所以要有for循环,是因为for循环在循环取值(遍历取值)比while循环更简洁3、如何用for循环语法:for 变量名 in 可 阅读全文

posted @ 2023-02-27 17:18 小小小传说 阅读(69) 评论(0) 推荐(0)

导航