摘要:
1、类似C语言中printf用法 b='name %s,age %d' % ('小康',18) 2、python中转义字符仅限\n,\t等,想打印字符应使用%+char b='中奖率 %.2f%%' % (1.35) 3、使用字典的情况下 tp="%(name)s %(age)d" % {'name 阅读全文
posted @ 2020-01-12 21:18
月光魔草
阅读(160)
评论(0)
推荐(0)
|
摘要:
1、类似C语言中printf用法 b='name %s,age %d' % ('小康',18) 2、python中转义字符仅限\n,\t等,想打印字符应使用%+char b='中奖率 %.2f%%' % (1.35) 3、使用字典的情况下 tp="%(name)s %(age)d" % {'name 阅读全文
posted @ 2020-01-12 21:18
月光魔草
阅读(160)
评论(0)
推荐(0)
摘要:
构造set() 添加函数add(self) 清空函数clear(self) 复制函数copy(self) 去除相同difference(self) difference_update(self) 清除指定元素,不报错discard(self) 取交集intersection(self) inters 阅读全文
posted @ 2020-01-12 17:55
月光魔草
阅读(859)
评论(0)
推荐(0)
摘要:
1、格式 li=[1,2,3,'a','b','c']#list列表 tu=(1,2,3,'a','b','c',)#tuple元祖 info={ 'k1':'v1', 'k2':'v2' }#字典,键值对key/value,其中vaule可以是任意值#列表、字典、bool不能做key,元祖、数字可 阅读全文
posted @ 2020-01-12 09:01
月光魔草
阅读(191)
评论(0)
推荐(0)
|