python
哈哈王戈多
https://blog.csdn.net/zh_94/article/details/81902492
展开
-
python中基础知识(一)
1.python中清除控制台的命令:#清空python控制台#在mac os x下,按CTRL+L,清空python控制台import sysimport os#用python来调用cls命令os.system('cls')f_handler=open('abc.log','w')oldstdout=sys.stdoutsys.stdout=f_handleros.sys...原创 2019-06-19 18:05:27 · 120 阅读 · 0 评论 -
python中基础知识(二)
1.python中的数字操作 --python中只有整数+浮点数两种数据类型,操作有:() ** -负号 [* / // %] [+ - ]#数字的基础知识#除号(/),不管是分子还是分母,计算结果都是浮点数#整除运算符(//), #1.如果对整数进行整除(分子和分母都是整数),结果就是整数,5//2=2 #2.如果分子和分母中有一个是浮点数,也可以整除除,但是计算出...原创 2019-06-21 14:52:48 · 1986 阅读 · 0 评论 -
python中基础知识(四)
1.定义列表#列表和元组-----序列#序列 --- 是数据元素的集合,数据元素可以是数值、字符串、布尔类型、对象等#序列的类型:列表和元组#列表name="Bill"names=["bill","mary","john"]#[]为列表标志#混合类型列表,因为Python是一种动态类型的语言,数据类型是后期绑定的values=["bills",True,False,10,20...原创 2019-06-26 11:52:12 · 483 阅读 · 0 评论 -
python中基础知识(三)
1.神奇的print函数#条件-if,循环-while+for和其它语句(print 、exec 、 eval)#神奇的print函数--print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)print("hello wrold");#hello wroldprint("a",'b','c','d','e...原创 2019-06-24 17:12:31 · 176 阅读 · 0 评论 -
python中基础知识(五)
1.字符串基本操作import oss1='i love python how are you'#print(s1[8])#y#print(s1[88])#error#利用分片截取字符串的子字符串#print(s1[7:13])#python#print(s1[7:])#python how are you#print(s1[7::2])#pto o r os2='a ...原创 2019-06-27 11:45:00 · 352 阅读 · 0 评论 -
python中基础知识(六)
字典# 创建和使用字典 class dict(**kwarg)class dict(mapping, **kwarg)class dict(iterable, **kwarg) # 列表 元组# 共同点:都是通过索引引用元素值# 不同点:列表是可读写的,元组是只读的 names = ["Bill", "Mike", "John", "Mary"] numbers = ["12...原创 2019-07-05 15:49:32 · 103 阅读 · 0 评论 -
用Python操作SQLite数据库
https://www.sqlite.org/index.htmlhttp://sqlitebrowser.org/原创 2019-09-11 12:07:35 · 91 阅读 · 0 评论