Join us and get access to thousands of tutorials and a community of expert Pythonistas.
This lesson is for members only.Join us and get access to thousands of tutorials and a community of expert Pythonistas.
The Python range() Function: Recap
You now understand how to userange() and work around its limitations. You also have an idea of how this important function has evolved between Python 2 and Python 3. The next time you need to perform an action a specific number of times, you’ll be all set toloop your heart out!
Congratulations, you made it to the end of the course! What’s your #1 takeaway or favorite thing you learned? How are you going to put your newfound skills to use? Leave a comment in thediscussion section and let us know.
00:00In this course,we saw how we can use Python’srange() function to generate lists of numbersto iterate over.We learned how to create lists of incrementing and decrementing numbers,how to reverse a list, and how to use thisrange() function alongside thefor loop toperform some sort of operation on each valuein our generated list.
00:26We also saw some of the technical limitations behind generating floating-pointvalues,and we learned how therange() function has evolved from Python 2 to Python 3,notably howrange() has replacedxrange().
00:45I hope you can see now why therange() function is so powerful.Whatever you are working on,you’re bound to run into a scenario where you need to iterate over a chunk ofcodex number of times,and you might even need to use that incrementing variable within your code.
JVargas onOct. 22, 2019
Great information.
Richard Childers onNov. 3, 2019
Good course. Clear, easy to understand, covered the basics well.
mikesult onMarch 1, 2020
Thank you Austin, this solidified my knowledge regarding range() and numpy.arange()
Ghani onOct. 15, 2020
Thank you Austin for this very useful tutorial!
boricua21dale onNov. 29, 2020
This course was awesome! def helped me go over the basics, its been a while since I’ve dove into Python. Thanks Austin!
Become a Member to join the conversation.
Course Contents

