# Author:Adminone
name = "my \tname is {name} and i am {year} old"
print(name.capitalize())
print(name.count("a"))
print(name.center(50,"-"))
print(name.endswith("ex"))
print(name.expandtabs(tabsize=30))
print("切片",name.find("name"))
print(name[name.find("name"):],"\n")
print(name.format(name='alex',year=23))
print(name.format_map( {'name':'alex','year':12} ),"\n")
print('ab23'.isalnum())
print('abA'.isalpha())
print('1A'.isdecimal()) #十进制
print('1A'.isdigit(),"\n") #整数
print('a 1A'.isidentifier()) #判读是不是一个合法的标识符,变量名
print('33A'.isnumeric(),"\n")
print('My Name Is '.istitle())
print('My Name Is '.isprintable()) #tty file ,drive file
print('my name is '.islower())
print('My Name Is '.isupper(),"\n")
print(''.join( ['1','2','3']) ) #将列表转换为字符串
print('+'.join( ['1','2','3']) ) #将列表转换为字符串,并用'+'分割
print( name.ljust(50,'*') ) #左对齐
print( name.rjust(50,'-') ) #右对齐
print( 'Alex'.lower() ) #转换为小写
print( 'Alex'.upper(),"\n" ) #转换为大写
print( '\nAlex'.lstrip() ) #去除左边的换行符,空格
print( 'Alex\n'.rstrip() ) #去掉右边的换行符,空格
print( ' Alex\n'.lstrip() )
print( ' Alex\n'.strip() ) #去掉两边的换行符,空格
p = str.maketrans("abcdefli",'123$@456') #加密方法 - 密码本
print("alex li".translate(p) ) #获取加密后的密码
print('alex li'.replace('l','L',1)) #替换第一个l为L
print('alex lil'.rfind('l'),"\n") #返回找到的最右边的字符下标
print('1+2+3+4'.split('+')) #按指定分隔符'+',转换成列表
print('1+2+3+4'.split('2')) #按指定分隔符'2',转换成列表
print('1+2\n+3+4'.splitlines()) #按指定分隔符'\n',转换成列表
print('Alex Li'.swapcase()) #大小写切换
print('leX li'.title()) #首字母大写,其他小写
print('lex li'.zfill(50)) #右对齐,左边用0填充
print( '---')