1 2 3 4
摘要: # 1、作用# 2、定义# msg='hello' # msg=str('msg')# print(type(msg))# 3、类型转换# str可以把任意其他类型都转成字符串# res=str({'a':1})# print(res,type(res))# 4、使用:内置方法# 4.1 优先掌握# 阅读全文
posted @ 2020-03-10 14:49 臭弟弟d 阅读(174) 评论(0) 推荐(0) 编辑
摘要: # 一:int类型# 1、作用:# 2、定义:# age = 10 # age=int(10)# 名字(参数)# print('hello','world')# x=int(10)# name=input('xxx')# res=print('xxx') # 没有产品(返回值)# print(res 阅读全文
posted @ 2020-03-10 14:47 臭弟弟d 阅读(722) 评论(0) 推荐(0) 编辑
摘要: '''1、什么是for循环 循环就是重复做某件事,for循环是python提供第二种循环机制2、为何要有for循环 理论上for循环能做的事情,while循环都可以做 之所以要有for循环,是因为for循环在循环取值(遍历取值)比while循环更简洁3、如何用for循环语法:for 变量名 in 可 阅读全文
posted @ 2020-03-10 14:45 臭弟弟d 阅读(183) 评论(0) 推荐(0) 编辑