#!/usr/bin/env python
# Author:Veray Zhou
name = "zhou wei lei"
print(name.capitalize())
print(name.count('e'))
print(name.center(50, '-'))
print(name.encode('utf-8'))
print(name.endswith('ei')) #判断是不是以ei结尾
print(name.find('lei'))#查找子串位置
name1 = "zhou\t wei lei"
print(name1.expandtabs(tabsize=30))
name2 = 'my name is {user},{year} old'
print(name2.format(user='zhou',year=23))
print(name2.format_map({'user':'zhou2','year':24}))
print('ab123'.isalnum())
print('AbCd'.isalpha())
print('147'.isdecimal())
print('258'.isdigit())
print('abc'.isidentifier())#判断是不是一个合法的标识符。变量名
print('abc'.islower())
print('ABC'.isupper())
print('333'.isnumeric())
print(' '.isspace())
print('My Name Is'.istitle())#单词首字母大小写
print('My Name Is'.isprintable())#是否可以打印
print(','.join(['1','2','3','4']))
print(name.ljust(50,'*'))
print(name.rjust(50,'*'))
print('Aaaa'.lower())
print('\nAaaa'.lstrip())
print('Aaaa\n'.rstrip())
print('\nAaaa\n'.strip())
print('Aaaa'.upper())
p = str.maketrans('abcdef', '123456')
print('apple'.translate(p))
print('zhou weilei'.replace('e','E',1)) #替换1个
print('zhou weilei'.rfind('e'))#最后边
print('zhou weilei'.split())
print('zhou weilei'.split('e'))
print('zhou\nwei\nlei'.splitlines())
print('zhouweilei'.startswith('zh'))
print('Zhou Wei'.swapcase())
print('zhou weilei'.title())
print('zhou weilei'.zfill(50))
Zhou wei lei
2
-------------------zhou wei lei-------------------
b'zhou wei lei'
True
9
zhou wei lei
my name is zhou,23 old
my name is zhou2,24 old
True
True
True
True
True
True
True
True
True
True
True
1,2,3,4
zhou wei lei**************************************
**************************************zhou wei lei
aaaa
Aaaa
Aaaa
Aaaa
AAAA
1ppl5
zhou wEilei
9
['zhou', 'weilei']
['zhou w', 'il', 'i']
['zhou', 'wei', 'lei']
True
zHOU wEI
Zhou Weilei
000000000000000000000000000000000000000zhou weilei