摘要:
1.不使用系统内置方法操作字符串 >>> str = '程序员' >>> str1 = str[:1] +'(加)' + str[1:2] + '(班)' + str[2:] >>> str1 '程(加)序(班)员' 2.内置函数 capitalize() 转换首字母为大写 >>> str = 'p 阅读全文
posted @ 2020-08-01 14:25
coder_xds
阅读(156)
评论(0)
推荐(0)
摘要:
1.创建和访问元组 >>> temp = (1,2,3,4,5,6) >>> temp[1] 2 >>> temp[5:] (6,) >>> temp[2:] (3, 4, 5, 6) >>> temp2 = temp[1:] >>> temp2 (2, 3, 4, 5, 6) 元组的访问同列表一样 阅读全文
posted @ 2020-08-01 12:59
coder_xds
阅读(126)
评论(0)
推荐(0)


浙公网安备 33010602011771号