
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 Wayground
15 questions
Python End of Topic Quiz

Quiz
•
8th Grade - University
20 questions
Day 6 - ONLINE TEST - PL03 PYTHON PROGRAMMING

Quiz
•
University
15 questions
Python Programming

Quiz
•
5th Grade - University
15 questions
Scratch Text Operators

Quiz
•
KG - Professional Dev...
11 questions
Python Lists

Quiz
•
10th Grade - University
20 questions
Final_QUIZ

Quiz
•
University
17 questions
HTML Forms and PHP Basics Quiz

Quiz
•
University
20 questions
Network ports

Quiz
•
1st Grade - University
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade