![](https://img-blog.csdnimg.cn/20200525145957762.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
python
python
小朋友,你是否有很多问号?
这个作者很懒,什么都没留下…
展开
-
demo0-python的一些
#ecoding=utf-8import timeprint("======================================")name=input("请输入你的姓名:")age=input("请输入你的年龄:")tel=input("请输入你的电话:")print("======正在生成信息,请稍等========")time.sleep(2)pr原创 2017-06-13 10:06:01 · 243 阅读 · 0 评论 -
demo1_string
print("==========================find================================")'''find检测str是否包含在mystr中,如果是返回开始的索引值,否则返回-1mystr.find(str,start=0,end=len(mystr))'''mystr ='hello world itcast and itc原创 2017-06-13 10:07:29 · 295 阅读 · 0 评论 -
demo2_列表
print("=====================================")A = ["zhangsan","lisi","wangwu"]print(A[0])print(A[1])print(A[2])print("============for循环==================")A = ["zhangsan","lisi","wangw原创 2017-06-13 10:07:50 · 278 阅读 · 0 评论 -
demo3_字段
'''字典和列表一样,也能够存储多个数据列表中找某个元素时,是根据下标进行的字典中找某个元素时,是根据'名字'(就是冒号:前面的那个值,例如上面代码中的'name'、'id'、'sex')字典的每个元素由2部分组成,键:值。例如 'name':'班长' ,'name'为键,'班长'为值'''print("===================================原创 2017-06-13 10:08:03 · 275 阅读 · 0 评论 -
demo4_元组
'''Python的元组与列表类似,不同之处在于元组的元素不能修改也可进行分片 和 连接操作. 元组使用小括号,列表使用方括号。'''print("====================访问元组=======================")tuple=('hello',100,3.14)print(tuple[0]+" %d"%tuple[1])原创 2017-06-13 10:08:20 · 274 阅读 · 0 评论 -
python的一些东西
1.如果python脚本中有汉字,需要在脚本的开始位置添加 #encoding=utf-82.查看变量的类型 type(field)3.查看版本中的关键字 import keyword(导入工具箱) keyword.kwlist原创 2017-06-13 10:05:40 · 300 阅读 · 0 评论