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

Wuhan University of technology Python Program Design Chapter 7 test

編輯:Python

The way to create an empty mutable set is :

A. s = set()

There's a string ’10111100’, be set(‘10111100’) As the result of the :

C. {‘0’, ‘1’}

The way to add elements to a collection is :

B. s.add(x)

s.remove(x) and s.discard(x) From the collection s Delete element x, The difference between them is :

B. x In collection s In the absence of , Use s.discard(x) No exception is fired

Python The mapping type in refers to :

C. Dictionaries

A collection is a collection of elements placed in {} Data types separated by commas in , About set , The correct choice below is :

A. Elements in a collection are unordered
B. There are no duplicate elements in the collection
C. The elements in the collection are immutable data types
D. Data in a mutable set can be added and deleted

The method to create an empty dictionary is :

A. d = dict() print(d)

C. d = {} print(d)

​ Methods to remove elements from a collection are

A. s.pop(x)
B. s.discard(x)
C. s.clear()
D. s.remove(x)

The following options can return a set s and t The set of all elements in is :


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