对于函数def test(x):
if isinstance(x, list):
x.append(4)
print x
elif isinstance(x, int):
x += 1
print x以下结果中正确的是哪一项?
选项:
A:>>> array = [1, 2, 3]
>>> test(array)
>>> [1, 2, 3];
B:>>> array = [1, 2, 3]
>>> test(array)
>>> [1, 2, 4];
C:>>> x = 3
>>> test(x)
>>> 4;
D:>>> x = 3
>>> test(x)
>>> 3
发布时间:2024-05-06 22:32:43