摘要: https://www.cnblogs.com/linhaifeng/articles/6113086.html ——————————————————————————————————————一、python中函数定义:函数是逻辑结构化和过程化的一种编程方法。python中函数定义方法: def te 阅读全文
posted @ 2018-05-27 22:03 小飞侠Kobe 阅读(350) 评论(0) 推荐(0) 编辑
摘要: 字符串格式化 —————————————————————————————————————————————————————一、百分号方式 #%s用于接收str格式,但数字,列表也能接收 msg='i am %s my hobby is %s' % ('lhf','alex')print(msg) 运行 阅读全文
posted @ 2018-05-27 16:08 小飞侠Kobe 阅读(109) 评论(0) 推荐(0) 编辑
摘要: s=set('hello')print(s) 运行结果:{'l', 'o', 'e', 'h'} s=set(['alex','alex','sb'])print(s) 运行结果:{'sb', 'alex'} s={1,2,3,4,5,6} #添加s.add('s')s.add('3')s.add( 阅读全文
posted @ 2018-05-27 14:12 小飞侠Kobe 阅读(123) 评论(0) 推荐(0) 编辑