Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Functions
#2
The key is that range can take a third parameter called step:

>>> list(range(2, 10, 2))
[2, 4, 6, 8]
>>> list(range(2, 10, 3))
[2, 5, 8]
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Functions - by kbranch3791 - Jan-17-2019, 05:59 PM
RE: Functions - by ichabod801 - Jan-17-2019, 06:10 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020