程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Wuhan University of technology Python Program Design Chapter 6 test

編輯:Python

ls = [25, 13, 36, 1]
ls.clear() And del ls The difference between the processing results of :

A.ls.clear() Just clear the list ,del ls Is to delete a list object

‌ The elements that can be generated are 0-9 The tabular derivation of the square of is

B. [x * x for x in range(10)]

Convert multiple integer inputs separated by commas into a list of integers , For example, the input ’1,2,3’, Turn to list [1,2,3]
The following statement is correct :

B. num = list(map(int, input().split(‘,’)))

list ls = [[‘Tom’, 24], [‘Jack’, 18], [‘Ada’, 20]] The second element of each sublist in is age , Output sorted by age , The correct procedure is :

A tuple is a set of data enclosed in parentheses , The data is separated by commas , The data in the following options are of tuple type :

A. ()
C. 1,
D. (1,2,3,4)

The main differences between tuples and lists are :

A. Tuples are immutable data types , Lists are variable data types
C. The delimiters of tuples are parentheses , The delimiter of the list is square brackets
D. The only built-in methods for tuples are count() and index(), There are many built-in methods for lists

In the case of determining the sequence length , Multivariable assignment


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved