设s="Python Programming",那么print(s[-5:])的结果是()。
A. mming
B. Python
C. Mmin
D. Pytho
查看答案
下列表达式中,能用于判断字符串s1是否属于字符串s(即s1是否s的子串)的是()。 ①s1 in s;②s.find(s1)>0;③s.index(s1)>0;④s.rfind(s1);⑤s.rindex(s1)>0
A. ①
B. ①②
C. ①③
D. ②③④⑤
re.findall('to','Tom likes to play football too.',re.I)的值是()。
A. ['To', 'to', 'to']
B. ['to', 'to', 'to']
C. ['To', 'to']
D. ['to', 'to']
下列程序执行后,得到的输出结果是()。 import re p=re.compile(r'\bb\w*\b') str="Boys may be able to get a better idea." print(p.sub('**',str,1))
A. ** may be able to get a better idea.
Boys may be able to get a ** idea.
C. Boys may ** able to get a better idea.
D. Boys may ** able to get a ** idea.
以下程序的输出结果是: t = “Python” print(t if t>=“python” else “None”)
A. Python
B. python
C. t
D. None