题目内容

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'

以下表达式( )是判断字符变量c是否为大写字母。

A. c.isupper()
B. c.islower()
C. c<='Z' and c>='A'
D. c<='z' and c>='a'

答案查题题库