Search Header Logo

Basic Data Structures Quiz

Authored by Rachel Anthony

Computers

Used 1+ times

Basic Data Structures Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

14 questions

Show all answers

1.

OPEN ENDED QUESTION

3 mins • 1 pt

Which of the following lines of code will cause an error? Use the following definition of ages: ages = (12, 5, 8) ages = ages + (1, 3, 5) print (ages[2]) ages = ages[2:] ages[0] = 3

Evaluate responses using AI:

OFF

2.

OPEN ENDED QUESTION

3 mins • 1 pt

What would the following program print to the screen when run? my_list = [7, 0, 0, "d", "n", "o", "B"] my_list.reverse() for thing in my_list: print (thing)

Evaluate responses using AI:

OFF

3.

OPEN ENDED QUESTION

3 mins • 1 pt

Given the following list: my_list = ["s", "Z", "e", "c", "c", "e", "r", "h", "e", "p", "t"] which program below would give the following output: s e c r e t for index in range(len(my_list)): print (str(index) + ". " + my_list)

Evaluate responses using AI:

OFF

4.

OPEN ENDED QUESTION

3 mins • 1 pt

Which of the following programs would produce the following output: 1. honey 2. bread 3. jelly 4. plates my_list = ["honey", "bread", "jelly", "plates"] for index in range(len(my_list)): print (str(index+1) + ". " + my_list[index])

Evaluate responses using AI:

OFF

5.

OPEN ENDED QUESTION

3 mins • 1 pt

Which of the following programs would alter my_list to consist of the following: [‘red’, ‘green’, ‘blue’, ‘orange’, ‘yellow’] my_list = ['red', 'green', 'blue', 'orange'] my_list.append('yellow')

Evaluate responses using AI:

OFF

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the value of num after this code runs? shapes = ["triangle", "square", "hexagon", "circle", "pentagon"] num = len(shapes)

0

4

5

35

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following data structures is immutable?

Tuple

List

Dictionary

2d List

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?