摘要:
字符串类型 1、作用2、定义 msg='hello' # msg=str('msg') print(type(msg)) <class 'str'> 3、类型转换str可以把任意其他类型都转成字符串 res=str({'a':1}) print(res,type(res)) {'a': 1} <cl 阅读全文
摘要:
数字类型 一:int类型1、作用:2、定义:age = 10 # age=int(10) 名字(参数) print('hello','world') hello world x=int(10)name=input('xxx')res=print('xxx') # 没有产品print(res) 2、类 阅读全文
摘要:
for循环-前言''' 1、什么是for循环 循环就是重复做某件事,for循环是python提供第二种循环机制 2、为何要有for循环 理论上for循环能做的事情,while循环都可以做 之所以要有for循环,是因为for循环在循环取值(遍历取值)比while循环更简洁 3、如何用for循环 语法: 阅读全文