Python 字符串问题

设字符串是 s1='Love',s2= 'Python',表达式len(s1)的值为 ,表达式max(s1)的值为(),表达式min(s1)的值为__,表达式s1.replace('v','V')的值为 ,表达式s1.split('o')的值为 ,表达式s1+s2的值为 ,表达式s2[2:4]的值为 ,表达式s2[:-1]的值为 ,表达式s2[0:7:3]的值为

跑一下就知道了:

s1='Love'
s2= 'Python'

print(len(s1))
print(max(s1))
print(min(s1))
print(s1.replace('v','V'))
print(s1.split('o'))
print(s1+s2)
print(s2[2:4])
print(s2[:-1])
print(s2[0:7:3])

img

4
v
L
LoVe
['L', 've']
LovePython
th
Pytho
Ph