int 和 str bool 类型

1 int类型

int > str

2 bool类型

3  str类型

1) upper() 改为大写

例如:

s = "sjdklsk"

s1 =s.upper(s)

print(s1)

结果:SJDKLSK

2)lower() 改为小写

例如:

s = "SjDklsK"

s1 = s.lower(s)

print(s1)

结果:sjdklsk

3) replace() 替换

s = "小猪佩奇,胡图图,旅游"

s1 = replace("佩奇")

4) split 切割

5)startswith() 以什么开头

6) len() 字符串长度

7) index()

猜你喜欢

转载自www.cnblogs.com/mlhz/p/9393493.html