Understanding Lists in Python

Understanding Lists in Python

7th Grade

20 Qs

quiz-placeholder

Similar activities

Kira- MS- U1/L1

Kira- MS- U1/L1

6th - 8th Grade

17 Qs

Quiz

Quiz

7th Grade

15 Qs

Informatika dan Keterampilan Generik SMP Kelas 7

Informatika dan Keterampilan Generik SMP Kelas 7

7th Grade

20 Qs

Quiz Pemrograman Kelas 7

Quiz Pemrograman Kelas 7

7th Grade

15 Qs

Quiz về Lập trình máy tính và Ngôn ngữ Python

Quiz về Lập trình máy tính và Ngôn ngữ Python

6th Grade - University

20 Qs

Osnove programskih jezika

Osnove programskih jezika

6th - 8th Grade

20 Qs

CT7-Group Quiz

CT7-Group Quiz

7th Grade

15 Qs

STRUKTUR DATA KELAS 7

STRUKTUR DATA KELAS 7

7th Grade

20 Qs

Understanding Lists in Python

Understanding Lists in Python

Assessment

Quiz

Information Technology (IT)

7th Grade

Medium

Created by

John Heatley

Used 1+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

fruits = "apple", "banana", "cherry"

fruits = ["apple", "banana", "cherry"]

fruits = {"apple", "banana", "cherry"}

fruits = ("apple", "banana", "cherry")

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you access the first element of the list `numbers = [10, 20, 30, 40]`?

numbers[1]

numbers[0]

numbers(0)

numbers.first()

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? ```python colours = ["red", "blue", "green"] print(colours[2]) ```

"red"

"blue"

"green"

"colours"

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following creates an empty list in Python?

empty = ()

empty = []

empty = {}

empty = ""

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given the list `animals = ["cat", "dog", "rabbit"]`, what does `animals[1]` return?

"cat"

"dog"

"rabbit"

1

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the index of "banana" in the list `fruits = ["apple", "banana", "cherry"]`?

0

1

2

3

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you access the last element of the list `numbers = [5, 10, 15, 20]` using a negative index?

numbers[-1]

numbers[-2]

numbers[3]

numbers[4]

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?