Python for loop/lists

Python for loop/lists

9th Grade

15 Qs

quiz-placeholder

Similar activities

CLC Lesson 6 Quiz

CLC Lesson 6 Quiz

University

12 Qs

Ujian Sumatif Informatika

Ujian Sumatif Informatika

10th Grade

20 Qs

COSRS_STEM 11H

COSRS_STEM 11H

11th Grade

20 Qs

Pengenalan Web dan HTML

Pengenalan Web dan HTML

10th Grade

18 Qs

Continue операторы

Continue операторы

9th - 12th Grade

10 Qs

Структурированный тип данных массив

Структурированный тип данных массив

10th Grade - University

11 Qs

Uji Pengetahuan Teknologi Informasi

Uji Pengetahuan Teknologi Informasi

9th Grade - University

20 Qs

The Linux Vault

The Linux Vault

University

15 Qs

Python for loop/lists

Python for loop/lists

Assessment

Quiz

Information Technology (IT)

9th Grade

Practice Problem

Easy

Created by

Fadi Fadi

Used 4+ times

FREE Resource

AI

Enhance your content in a minute

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

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does a for loop do in Python?

Repeats a block of code while a condition is true

Chooses a random element from a list

Repeats a block of code for each item in a sequence

Declares a function

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of this code? python CopyEdit fruits = ['apple', 'banana', 'cherry'] for fruit in fruits: print(fruit)

apple banana cherry

['apple', 'banana', 'cherry']

fruit fruit fruit

Error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid list?

[1, 2, 3, 4]

(1, 2, 3, 4)

{1, 2, 3, 4}

"1, 2, 3, 4"

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many times will this loop run? for i in range(5): print(i)

4

5

6

Infinite

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the index of 'dog' in this list? animals = ['cat', 'dog', 'lion']

0

1

2

3

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does this print? python CopyEdit numbers = [10, 20, 30] print(numbers[1])

10

20

30

Error

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of range() in a for loop?

To shuffle the list

To create a loop that counts

To sort items

To reverse a list

Create a free account and access millions of resources

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?