python题目

strNew=str.split()
strNew=’’.join(strNew)
print(strNew)在这里插入图片描述
在这里插入图片描述
s=“hello.jsp”
s1=“http//www.baidu.com”
print(s.endswith(’.jsp’))
print(s.startswith(‘http://’))在这里插入图片描述
s=“hello”
print(s[0])
print(s[-1])
print(s[:])
print(s[:3])
print(s[::-1])
print(s[1:])
print(s*10)
print(s+‘World’)
print('he’in s)
print('aa’in s)在这里插入图片描述
在这里插入图片描述
names=[“Lihua”,“Rain”,“Jack”,“XiuXiu”,“Peiqi”,“Black”]
names[names.index(“XiuXiu”)]=“秀秀”
names.insert(2,[“oldboy”,“oldgirl”])
print(names)

发布了18 篇原创文章 · 获赞 0 · 访问量 233

猜你喜欢

转载自blog.csdn.net/weixin_43663780/article/details/104110047