Search Header Logo

Python Sets

Authored by surag patel

Computers

9th - 12th Grade

Used 1+ times

Python Sets
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

32 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which one of these is a set?

myset = ('apple', 'banana', 'cherry')

myset = ['apple', 'banana', 'cherry']

myset = {'apple', 'banana', 'cherry'}

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Set items cannot be removed after the set has been created.

True

False

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A set cannot have two items with the same value.

True

False

4.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Select the correct function for returning the number of items in a set:
fruits = {'apple', 'banana', 'cherry'}
print(___________(fruits))

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

True or False. You can access set items by referring to the index.

True

False

6.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Check if "apple" is present in the fruits set.

fruits = {"apple", "banana", "cherry"}

if "apple" _______ fruits: print("Yes, apple is a fruit!")

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following code:
thisset = {'apple', 'banana', 'cherry'}
print('banana' not in thisset)
What will be the printed result?

True

False

{'apple', 'cherry'}

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?