题目内容

利用print()格式化输出,能够控制浮点数的小数点后两位输出的是( )

A. {.2f}
B. {:.2f}
C. {.2}
D. {:.2}

查看答案
更多问题

以下程序运行结果是:()mylist=[1,2,3,4,5]for i in range(len(mylist)):mylist[i]+=1print(mylist)

A. [1, 2, 3, 4, 5]
B. [1 2 3 4 5]
C. [2, 3, 4, 5, 6]
D. [2 3 4 5 6]

下面代码的输出结果是( )a = [1,3]b = [2,4]a.extend(b)print(a)

A. [4 ,2 ,3 ,1]
B. [1 ,2 ,3 ,4]
C. [1, 3, 2, 4]
D. [4 ,3 ,2 ,1]

下面代码的输出结果是( )list1 = [1,2,3]list2 = [4,5,6]print(list1+list2)

A. [1,2,3]
B. [1, 2, 3, 4, 5, 6]
C. 4,5,6]
D. [5,7,9]

下面代码的输出结果是( )list1 = []for i in range(1,11):list1.append(i**2)print(list1)

A. [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
B. [0,1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
C. [0,2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
D. 2, 4, 6, 8, 10, 12, 14, 16, 18, 20]

答案查题题库