Search Header Logo

RL Python Basics Quiz 2

Authored by Aahnik Daw

Computers

9th - 12th Grade

Used 4+ times

RL Python Basics Quiz 2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

string = "Python is awesome"

string[9:3:-1]

' si no'

' '

' si noh'

'i no'

2.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

my_dict = {

"apple": 5,

"banana": 10,

"brinjal": 30

}

my_dict.items() will give ?

all the values

all the keys

the entire dictionary

tuple of key value pairs

3.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

How can I delete all the items from a set in python ?

my_set = {1,2,3,4,5,6}

my_set.clear()

for item in my_set:
  my_set.remove(item)
for item in my_set:
  my_set.discard(item)
my_set.discard()

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

s1 = {3,4,5,6}
s2 = {2,3,9,6,12}
s1.intersection(s2)

{3, 6}

{2,3,6}

{5,9,6}

{3,4,5,6}

5.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Find the elements in set a that are not in set b

a - b

a.union(b)

a.intersection(b)

a.symmetric_difference(b)

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

a = {1,2,3,4,5}
b = {2,3,4,9 , 10}
c = {6,7,8,9}

print(a.isdisjoint(b))
print(b.isdisjoint(c))
print(a.isdisjoint(c))

False

False

True

True

False

False

False

True

False

False

True

True

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

a = {1,2,3,4,5,10}
b = {2,3,4,9 , 10}
c = {6,7,8,9}

print((a-b).issubset(a))
print(a.issubset(b))
print(b.issuperset(c))
print(a.symmetric_difference(c).issuperset(b))

True

False

False

True

False

False

False

True

False

True

False

True

True

True

False

False

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?