Search Header Logo

PCEP-PREP QUIZ 2

Authored by Magikid Chino Hills

Computers

6th - 8th Grade

Used 4+ times

PCEP-PREP QUIZ 2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

11 questions

Show all answers

1.

MULTIPLE SELECT QUESTION

45 sec • 2 pts

Media Image

Which of the following are being used in this snippet of code?

Function Invocation

parameters

Return

Try and Catch

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the main difference between tuples and list?

tuples have [] and list have ()

Tuples have () and list have []

tuples can be change and list cannot be changed

tuples cannot be changed and list can be changed

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do dictionaries in python differ from list and tuples?

Dictionaries are a combination of list and tuples

Dictionaries can be modified and also be allowed to not modify

Dictionaries are like a hash table, where there are key-value pairs

Dictionaries have 2 list within to be able to access both at same time

4.

MULTIPLE SELECT QUESTION

45 sec • 2 pts

word = "Hello"

Which of the following will print 'll'?

print(word[2:3])

print(word[2:4])

print(word[-3:-1])

print(word['ll'])

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Which of the following is the correct snippet of code for the function 'find'?

The function 'find' should be given a letter to find and a word to search within.

if char in word:

return True

else:

return False

while True:

find char in word

return True/False

if word has char:

return False

else:

return True

Return True;

Return False;

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Which line has an error?

19

21

23

18

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How is a try and catch used in python?

It is like an if then else which shows our error if there is one and it does not

It is used to check if a snippet of code has an error and if it does it allows us to handle the error without terminating the program

it tries a snippet of code then it catches the value that it sends, similar as a return

It returns an error and terminates the program so we may identify what was the issue

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?