• 2022-07-24
    a=[1,2,3,4,5,6,7,8,9,10],命令a[-7:-2]返回结果是()
  • [4,5,6,7,8]

    内容

    • 0

      以下程序的输出结果是( )。 frame<br/>= &#91;&#91;1,2,3&#93;,&#91;4,5,6&#93;,&#91;7,8,9&#93;&#93; rgb<br/>= frame&#91;: : -1&#93; print(rgb) A: [[1,<br/>2, 3], [4, 5, 6]] B: [[7,<br/>8, 9], [4, 5, 6], [1, 2, 3]] C: [[1,2,3],[4,5,6],[7,8,9]] D: [[7,<br/>8, 9]]

    • 1

      如下函数的返回值是___________def test(): temp=&#91;1,2,3,4,5,6,7,8,9,10&#93; return &#91;x for x in temp if x%3==2&#93; A: [2, 5, 8] B: [1, 3, 6] C: [3, 6, 9] D: [1, 4, 7]

    • 2

      以下程序的输出结果是:[br][/br]frame = &#91;&#91;1,2,3&#93;,&#91;4,5,6&#93;,&#91;7,8,9&#93;&#93;[br][/br]rgb = frame&#91;::-1&#93;[br][/br]print(rgb) A: [[1, 2, 3], [4, 5, 6]] B: [[7, 8, 9]] C: [[1,2,3],[4,5,6],[7,8,9]] D: [[7, 8, 9], [4, 5, 6], [1, 2, 3]]

    • 3

      ‍请在下面空格处填写答案(两行结果中间用一个半角分号分隔)。​‍>>> import numpy as np >>> a = np.array(&#91;(1, 2, 3), (4, 5, 6), (7, 8, 9)&#93;) >>> a.shape (______) >>> a&#91;&#91;2&#93;&#93;.sum() _______​

    • 4

      已知a=&#91;1 2 3; 4 5 6; 7 8 9&#93;,执行命令:a(&#91;3,1&#93;,:)=a(&#91;1,3&#93;,:),a将变为( )。 A: [4 5 6;4 5 6;4 5 6] B: [7 8 9;4 5 6;1 2 3] C: [2 2 2;5 5 5;8 8 8] D: [3 2 1;6 5 4;9 8 7]