Practice General Function Behavior (11.2.1) - More about range() - Data Structures and Algorithms in Python
Students

Academic Programs

AI-powered learning for grades 8-12, aligned with major curricula

Professional

Professional Courses

Industry-relevant training in Business, Technology, and Design

Games

Interactive Games

Fun games to boost memory, math, typing, and English skills

General function behavior

Practice - General function behavior

Learning

Practice Questions

Test your understanding with targeted questions

Question 1 Easy

What does range(4) return?

💡 Hint: Remember the start is 0 and it excludes the stop.

Question 2 Easy

If you use range(1, 5), what numbers do you get?

💡 Hint: Excludes the stop value of 5.

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

Question 1

What does range(1, 10, 3) produce?

1
4
7
1
3
6
9
1
2
3
4
5

💡 Hint: Focus on how increments affect the sequence.

Question 2

True or False: In Python 3, range produces a list.

True
False

💡 Hint: Think about what type 'range' returns in Python 3.

2 more questions available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

Write a Python function that returns all odd numbers between 1 and 100 using the range function.

💡 Hint: Focus on how to set your start, stop, and step values.

Challenge 2 Hard

Explain how you would adjust the range to include numbers below zero, and provide code as an example.

💡 Hint: Consider how stepping affects both the start and stop.

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.