随笔分类 -  python学习

上一页 1 2 3 4 5 6 ··· 11 下一页
个人学习使用,所有收集仅供参考。
摘要:#! /usr/bin/python x={'a':'aaa','b':'bbb','c':12} print (x['a']) print (x['b']) print (x['c']) for key in x: print ("Key is %s and value is %s" %  阅读全文
posted @ 2019-07-25 14:01 樊伟胜 阅读(473) 评论(0) 推荐(0)
摘要:#! /usr/bin/python # -*- coding: utf8 -*- #列表类似Javascript的数组,方便易用 #定义元组 word=['a','b','c','d','e','f','g'] #如何通过索引访问元组里的元素 a=word[2] print ("a is: "+a 阅读全文
posted @ 2019-07-25 14:00 樊伟胜 阅读(544) 评论(0) 推荐(0)
摘要:#打开新窗口,输入: #! /usr/bin/python # -*- coding: utf8 -*- s1=input("Input your name:") print("你好,%s" % s1) ''' 知识点: * input("某字符串")函数:显示"某字符串",并等待用户输入. * p 阅读全文
posted @ 2019-07-25 13:59 樊伟胜 阅读(1992) 评论(0) 推荐(0)
摘要:但有趣的是,在javascript里我们会理想当然的将字符串和数字连接,因为是动态语言嘛.但在Python里有点诡异,如下: #! /usr/bin/python a=2 b="test" c=a+b 运行这行程序会出错,提示你字符串和数字不能连接,于是只好用内置函数进行转换 #! /usr/bin 阅读全文
posted @ 2019-07-25 13:59 樊伟胜 阅读(13738) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-07-24 17:10 樊伟胜 阅读(1036) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-07-24 17:09 樊伟胜 阅读(428) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-07-24 17:08 樊伟胜 阅读(167) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-07-24 17:07 樊伟胜 阅读(159) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-07-24 17:06 樊伟胜 阅读(306) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-07-24 17:05 樊伟胜 阅读(250) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-07-24 17:04 樊伟胜 阅读(238) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-07-24 17:03 樊伟胜 阅读(341) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-07-24 17:02 樊伟胜 阅读(389) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-07-24 17:02 樊伟胜 阅读(202) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-07-24 16:35 樊伟胜 阅读(158) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-07-24 16:24 樊伟胜 阅读(339) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-07-24 16:23 樊伟胜 阅读(347) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-07-24 16:21 樊伟胜 阅读(257) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-07-24 16:17 樊伟胜 阅读(224) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-07-24 15:59 樊伟胜 阅读(305) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 ··· 11 下一页