下面代码的执行结果是()。 ls = [“2020”, “20.20”, “Python”] ls.append(2020) ls.append([2020, “2020”])print(ls)
下面代码的执行结果是()。 ls = [“2020”, “20.20”, “Python”] ls.append(2020) ls.append([2020, “2020”])print(ls)
ls = ['I','LOVE'] def func(a): ls = [] ls.append(a) return func('WTU') print(ls)
ls = ['I','LOVE'] def func(a): ls = [] ls.append(a) return func('WTU') print(ls)
对于列表ls=[1,2,3],如果希望ls变为[1,2,3,4],可以通过以下哪些方法实现: A: ls.append(4) B: ls=ls+4 C: ls+=[4] D: ls.insert(3,4) E: ls.append([4])
对于列表ls=[1,2,3],如果希望ls变为[1,2,3,4],可以通过以下哪些方法实现: A: ls.append(4) B: ls=ls+4 C: ls+=[4] D: ls.insert(3,4) E: ls.append([4])
列表ls,哪个选项对ls.append(x)的描述是正确的?
列表ls,哪个选项对ls.append(x)的描述是正确的?
给出如下代码: ls = ["car","truck"] def funC(a): ls.append(a) return funC("bus") print(ls) 以下选项中描述错误的是
给出如下代码: ls = ["car","truck"] def funC(a): ls.append(a) return funC("bus") print(ls) 以下选项中描述错误的是
中国大学MOOC: ls = [1, 2, 3, 4, 5]ls.append([6, 7, 8])print(len(ls))代码的输出结果是?
中国大学MOOC: ls = [1, 2, 3, 4, 5]ls.append([6, 7, 8])print(len(ls))代码的输出结果是?
ls = [“2020”, “20.20”, “Python”] ls.append(2020) ls.extend([2020, “2020”]) 执行完以上代码后ls的值是:
ls = [“2020”, “20.20”, “Python”] ls.append(2020) ls.extend([2020, “2020”]) 执行完以上代码后ls的值是:
下面代码的执行结果是: ls = [“2020”, “2020”, “Python”] ls.append(2020) ls.append([2020, “2020”]) print(ls): [‘2020’, ‘2020’, ‘Python’, 2020, 2020, ‘2020’]|[‘2020’, ‘2020’, ‘Python’, 2020, [2020, ‘2020’]]|[‘2020’, ‘2020’, ‘Python’, 2020, [‘2020’]]|[‘2020’, ‘2020’, ‘Python’, 2020]
下面代码的执行结果是: ls = [“2020”, “2020”, “Python”] ls.append(2020) ls.append([2020, “2020”]) print(ls): [‘2020’, ‘2020’, ‘Python’, 2020, 2020, ‘2020’]|[‘2020’, ‘2020’, ‘Python’, 2020, [2020, ‘2020’]]|[‘2020’, ‘2020’, ‘Python’, 2020, [‘2020’]]|[‘2020’, ‘2020’, ‘Python’, 2020]
ls = ['2021', '20.21 ', 'Python'] ls.append(2021) ls.append([2021, '2021']) print(ls) A: ['2021', '20.21 ', 'Python', 2021, 2021, '2021'] B: ['2021', '20.21 ', 'Python', 2021] C: ['2021', '20.21 ', 'Python', 2021, [2021, '2021']] D: ['2021', '20.21 ', 'Python', 2021, ['2021']]
ls = ['2021', '20.21 ', 'Python'] ls.append(2021) ls.append([2021, '2021']) print(ls) A: ['2021', '20.21 ', 'Python', 2021, 2021, '2021'] B: ['2021', '20.21 ', 'Python', 2021] C: ['2021', '20.21 ', 'Python', 2021, [2021, '2021']] D: ['2021', '20.21 ', 'Python', 2021, ['2021']]
ls = [1, 2, 3, 4, 5]ls.append([6, 7, 8])print(len(ls))代码的输出结果是? A: 5 B: 3 C: 8 D: 6
ls = [1, 2, 3, 4, 5]ls.append([6, 7, 8])print(len(ls))代码的输出结果是? A: 5 B: 3 C: 8 D: 6