Movatterモバイル変換


[0]ホーム

URL:


Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Locked learning resources

This lesson is for members only.Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

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.

01:04Therange() function makes all of this possible.

01:09I’m Austin Cepalia with realpython.com. Happy coding!

Avatar image for JVargas

JVargas onOct. 22, 2019

Great information.

Avatar image for Richard Childers

Richard Childers onNov. 3, 2019

Good course. Clear, easy to understand, covered the basics well.

Avatar image for mikesult

mikesult onMarch 1, 2020

Thank you Austin, this solidified my knowledge regarding range() and numpy.arange()

Thank you Austin for this very useful tutorial!

Avatar image for boricua21dale

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

Overview
100%

[8]ページ先頭

©2009-2026 Movatter.jp