Understanding Python Lists and More

Understanding Python Lists and More

12th Grade

10 Qs

quiz-placeholder

Similar activities

Test on Python Function

Test on Python Function

11th - 12th Grade

12 Qs

Types of Mass Media

Types of Mass Media

10th Grade - Professional Development

11 Qs

BTEC National ICT U2 - Microsoft Access

BTEC National ICT U2 - Microsoft Access

12th Grade

10 Qs

Python pandas 🐼

Python pandas 🐼

12th Grade

10 Qs

Evaluación Diagnóstica de Computación

Evaluación Diagnóstica de Computación

6th Grade - University

12 Qs

ASK FORM 3 MICROSOFT ACCESS

ASK FORM 3 MICROSOFT ACCESS

KG - University

10 Qs

Word 2016 Lesson 1

Word 2016 Lesson 1

9th - 12th Grade

10 Qs

Keyboard Shortcuts

Keyboard Shortcuts

9th - 12th Grade

9 Qs

Understanding Python Lists and More

Understanding Python Lists and More

Assessment

Quiz

Computers

12th Grade

Practice Problem

Hard

Created by

David Hunt

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to create a list in Python?

`my_list = (1, 2, 3, 4)`

`my_list = [1, 2, 3, 4]`

`my_list = {1, 2, 3, 4}`

`my_list = "1, 2, 3, 4"`

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? ```python my_tuple = (10, 20, 30) print(my_tuple[1]) ```

`10`

`20`

`30`

`1`

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements about Python dictionaries is true?

Dictionaries are ordered collections of values.

Dictionaries store data as key-value pairs.

Dictionaries can only have integer keys.

Dictionaries are created using square brackets.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the value of `result` after executing the following code? ```python numbers = [2, 4, 6, 8] result = numbers[2] + numbers[0] ```

`6`

`8`

`10`

`12`

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to write a for loop that prints each item in a list called `fruits`?

`for fruit in fruits: print(fruit)`

`for fruit of fruits: print(fruit)`

`for (fruit; fruits): print(fruit)`

`for fruit to fruits: print(fruit)`

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? ```python my_dict = {'apple': 3, 'banana': 5} print(my_dict['banana']) ```

`3`

`5`

`'banana'`

`None`

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements about tuples is correct?

Tuples are mutable.

Tuples can contain elements of different data types.

Tuples are created using curly braces.

Tuples cannot be indexed.

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?