Search Header Logo

4QFPy

Authored by Tina Voci

Computers

7th Grade

Used 2+ times

4QFPy
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 CHOICE QUESTION

30 sec • 1 pt

You are tasked with creating an appropriate structure to store student names. The client would like the ability to pass in a name and wants to be sure that there can't be two students with the same name. Which would be the most suitable to use? Mark the correct answer(s)

Dictionary

List containing tuples

Nested list

Set

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which list function returns the number of items contained in the list?

Mark the correct answer(s)

len(listname)

listname.len()

listname.length()

length(listname)

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following modes of file reading would be most appropriate for a program designed to update the contents of a .txt file without making any new deletion to the file. Mark the correct answer(s)

a

re

r

w

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which collection structure allows items that are ordered and changeable and contain duplicate values? Mark the correct answer(s)

Set

List

Tuple

Dictionary

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A programmer accidentally attempts convert the type of an object and receives the error: "int() cannot convert 'dog' into an integer". What error was likely raised in this instance? Mark the correct answer(s)

Value Error

Type Error

Name Error

Attribute Error

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following methods allows multiple items from a string to be added as individual elements to an existing list? Example:

list_one = [1,2,3]

string_one = 'abc'

list_one.method(string_one)

list_one = [1, 2, 3, 'a', 'b', 'c']

Mark the correct answer(s)

extend()

pop()

insert()

append()

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code snippet?

careful = 0

second_chance = True

if careful: print('I got a second chance at this!')

elif second_chance: print('I am not being careful...')

else: print('I am being careful!')

Mark the correct answer(s)

'I am being careful!'

The execution will not enter the if-else statement.

'I am not being careful...'

'I got a second chance at this!'

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?