标签:-name with print 实现 开头 str 要求 位置 oldboy
name = " aleX"
复制代码
name=" alex"
print(name.strip())
print(name.startswith(‘al‘))
print(name.endswith(‘x‘))
print(name.replace(‘l‘,‘p‘))
print(name.split(‘l‘))
print(name.upper())
print(name.lower())
print(name[1])
print(name[:3])
print(name[-2:-1])
print(name.index(‘e‘))
print(name[:-1])
标签:-name with print 实现 开头 str 要求 位置 oldboy
原文地址:https://www.cnblogs.com/tangege/p/14012927.html