命令:s=‘Ihaveadog,Ihaveacat’re.findall(r’Ihavea(?:dog|cat)’,s)的执行结果是:
A. $contentAnswer
B. (Ihaveadog,cat)
C. (Ihaveadog,Ihaveacat)
D. [Ihaveadog,Ihaveacat]
查看答案
命令print(one\ntwo\tthree)执行结果是:
A. one\ntwo\tthree
B. onetwothree
C. one(换行)two(换行)three
D. one(换行)twothree
去掉字符串s='&&&&good&&&'两边的”&“并显示出来,下面哪个命令是正确的:
A. s.lstrip('&')
B. s.rstrip('&')
C. s.astrip('&')
D. s.strip('&')
去掉字符串title='_-_-scitc_-_-'右边的”_-_-“部分,下面哪个命令是正确的:
A. title.lstrip('_-')
B. title.rstrip('_-')
C. title.strip('_-')
D. title.astrip('_-')
如果要打印1-100之间的偶数,下面哪个语句的表示是正确的:
A. i=0whilei<100:print(i+2,end='')i=i+2
B. i=2whilei<100:print(i,end='')i=i+2
C. i=2whilei<101:print(i+2,end='')i=i+2
D. i=0whilei<101:print(i+1,end='')i=i+1