设s='a,b,c',则s.split(',')的值为(),s.rsplit(',',1)的值为()。①['a','b','c']②['a,b','c']
查看答案
s2=('x','y','z'),s3=':',s3.join('abc')的值为(),s3.join(s2)的值为()。
A. 'a,b,c';'x,y,z'
B. 'a:b:c';'x:y:z'
设s='abcdefg',则s[3]的值是(),s[3:5]的值是(),s[:5]的值是(),s[3:]的值是(),s[::2]的值是(),s[::-1]的值是(),s[-2:-5]的值是()。
A. 'de','d','abcde','defg','aceg','gfedcba',''
B. 'de','d','defg','abcde','aceg','gfedcba',''
C. 'de','d','defg','abcde','gfedcba','aceg',,''
D. 'd','de','abcde','defg','aceg','gfedcba',''
已知s1='redhat',print(s1.upper())的结果是(),s1.swapcase()的结果是(),s1.title()的结果是(),s1.replace('hat','cat')的结果是()。
A. REDHAT,REDHAT,'RedHat','redcat'
B. REDHAT,'RedHat','REDHAT','redcat'
C. REDHAT,'REDHAT','RedHat','redcat'
D. REDHAT,'redcat','REDHAT','RedHat'
判断字符变量c是否为字母字符(不区分大小写字母),以下表达式正确的是( )。
A. c.isalpha()
B. c.lower()<='z' and c.lower()>='a'
C. c.upper()<='Z' and c.upper()>='A'
D. c<='Z' and c >='A'or c<='z'and c >='a'