1.python代码如下:
foo = [1,2]
foo1 = foo
foo.append(3)
A.foo 值为[1,2]
B.foo 值为[1,2,3]
C.foo1 值为[1,2]
D.foo1 值为[1,2,3]
答案:B D
链接:https://www.nowcoder.com/profile/153165401/myFollowings/detail/20055659
来源:牛客网
2.下列程序打印结果为( )
import re
str1 = "Python's features"
str2 = re.match( r'(.*)on(.*?) .*', str1, re.M|re.I)
print str2.group(1)
A.Python
B.Pyth
C.thon’s
D.Python‘s features
答案:B
re.match(正则表达式,要匹配的字符串,[匹配模式])
re.M:多行匹配,影响 ^ 和 $
re.I:使匹配对大小写不敏感
链接:https://www.nowcoder.com/profile/153165401/myFollowings/detail/20055659
来源:牛客网
3.从运行层面上来看,从四个选项选出不同的一个
A.JAVA