上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 27 下一页
摘要: #!/usr/bin/python #coding=utf-8 #好好学习,天天向上 python=["a","b","c","d","e","f"] message=f"my name is {python[3].title()}" print(message) python列表索引从0开始,最后 阅读全文
posted @ 2020-12-27 20:56 tigergaonotes 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 转:https://www.tuicool.com/wx/vYjaYnV 在 Python 中,如果想要操作文件,首先需要创建或者打开指定的文件,并创建一个文件对象,而这些工作可以通过内置的 open() 函数实现。 open() 函数用于创建或打开指定文件,该函数的常用语法格式如下: file = 阅读全文
posted @ 2020-12-27 10:48 tigergaonotes 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 转:https://www.tuicool.com/wx/MB7nieb 数据类型 整数, 浮点数, 字符串, 布林值(True,False) 列表(list), 不可变的列表 Tuple, 集合(没有顺序的概念),set 字典(key value pair), 变量. 后面其实就是解析一下上面的数 阅读全文
posted @ 2020-12-27 10:46 tigergaonotes 阅读(71) 评论(0) 推荐(0) 编辑
摘要: 备注:列表元素索引下限从0开始,列表用[ ]表示 阅读全文
posted @ 2020-12-26 22:30 tigergaonotes 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 备注:#用来注释代码,#后面的内容会被python解释器忽略 阅读全文
posted @ 2020-12-26 22:25 tigergaonotes 阅读(110) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python #coding=utf-8 i=1.0 j=3 print(i*j) print(i+j) print(i**j) 备注:无论是哪种运算,只要有操作数是浮点数,python默认得到的都是浮点数,结果也总是浮点数 阅读全文
posted @ 2020-12-26 22:19 tigergaonotes 阅读(248) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python #coding=utf-8 i=1 j=3 print(i*j) print(i**j) 阅读全文
posted @ 2020-12-26 22:16 tigergaonotes 阅读(104) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python #coding=utf-8 message="python" print(message) print("\tpython") print("hello\npython\nhello\nworld") 阅读全文
posted @ 2020-12-26 22:09 tigergaonotes 阅读(85) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python #coding=utf-8 first_name='tiger' last_name='gao' full_name= f"{first_name} {last_name}"--f为format的缩写 print(full_name) print(full_nam 阅读全文
posted @ 2020-12-26 21:59 tigergaonotes 阅读(48) 评论(0) 推荐(0) 编辑
摘要: 所以这里需要注意变量的使用,print(message),直接去引用,和shell略有不同 1、变量名只能包含字母,数字,下划线,但不能以数字开头 2、变量名不能含有空格 阅读全文
posted @ 2020-12-25 22:36 tigergaonotes 阅读(61) 评论(0) 推荐(0) 编辑
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 27 下一页