下面哪个是集合?

Python Sets Quiz

Quiz
•
Computers
•
University
•
Medium

Shiwen Zhang
Used 1+ times
FREE Resource
16 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
myset = 'apple, banana, cherry'
myset = {'apple', 'banana', 'cherry'}
myset = ['apple', 'banana', 'cherry']
myset = ('apple', 'banana', 'cherry')
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
下面哪个表述方式可以在python里面表示一个集合?
myset = ('apple', 'banana', 'cherry')
myset = ['apple', 'banana', 'cherry']
myset = {'apple', 'banana', 'cherry'}
set myset = {'apple', 'banana', 'cherry'}
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
下面哪个语句不可以定义一个集合?
myset = ('apple', 'banana', 'cherry')
myset = {'apple', 'banana', 'cherry'}
myset = set(['apple', 'banana', 'cherry'])
myset = {'apple', 'banana', 'cherry', 'apple'}
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
您可以通过引用索引来访问集合项
错
对
5.
FILL IN THE BLANK QUESTION
1 min • 1 pt
完善语句,使代码可以检查apple是否存在于fruits集合中
fruits = {"apple", "banana", "cherry"}
if "apple" ___fruits:
print("Yes, apple is a fruit!")
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
考虑以下代码运行后的结果为:
thisset = {'apple', 'banana', 'cherry'}
print('banana' not in thisset)
True
False
{'apple', 'cherry'}
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
下面哪个方法可以添加一个元素到集合中
add()
insert()
push()
Create a free account and access millions of resources
Similar Resources on Quizizz
20 questions
Google meet 3

Quiz
•
3rd Grade - University
20 questions
Bertelsmann AI Track Quiz Initiative #3

Quiz
•
University - Professi...
11 questions
Python Lists

Quiz
•
10th Grade - University
11 questions
20240808

Quiz
•
University
15 questions
Python End of Topic Quiz

Quiz
•
8th Grade - University
20 questions
list 6th

Quiz
•
7th Grade - University
15 questions
Python Programming

Quiz
•
5th Grade - University
17 questions
Operators in Python

Quiz
•
9th Grade - Professio...
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade