Python Range(), For,While Loops Flashcard

Python Range(), For,While Loops Flashcard

Assessment

Flashcard

Computers

8th Grade

Practice Problem

Hard

Created by

Wayground Content

FREE Resource

Student preview

quiz-placeholder

16 questions

Show all answers

1.

FLASHCARD QUESTION

Front

What is the syntax of the range() function?

Back

range(start, stop, step)

2.

FLASHCARD QUESTION

Front

What is the default start value of the range() function if not specified?

Back

0

3.

FLASHCARD QUESTION

Front

What will be the output of range(1, 10)?

Back

It will output a sequence of numbers from 1 to 9.

4.

FLASHCARD QUESTION

Front

What will be the output of range(10)? Options: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10; 0, 1, 2, 3, 4, 5, 6, 7, 8, 9; 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10; 1, 2, 3, 4, 5, 6, 7, 8, 9

Back

0, 1, 2, 3, 4, 5, 6, 7, 8, 9

5.

FLASHCARD QUESTION

Front

Write a Python code to print all the even numbers between 1 and 10 using the range() function.

Back

for num in range(2, 11, 2):
print(num)

6.

FLASHCARD QUESTION

Front

What is commonly used with for loops to iterate a specific number of times?

Back

range

7.

FLASHCARD QUESTION

Front

What is the purpose of a while loop?

Back

To repeat a block of code as long as a specified condition is true

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

Already have an account?

Discover more resources for Computers