Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
For \ While loops
#3
(Oct-31-2018, 02:30 PM)j.crater Wrote: Hello and welcome to Python and the forums!
In Python, when you have begin and end index (such as in range/xrange, or in slicing iterables - iterable[2,4]), the item belonging to begin index is included in the result, while the item belonging to end index isn't. Therefore, if you want num2 to be included in the xrange, you'll need to provide it num2+1 as end index.
Next time when posting code, please use Python code tags.
Thanks , sorry for posting here I am new to the forums
Reply


Messages In This Thread
For \ While loops - by Itay - Oct-31-2018, 02:23 PM
RE: For \ While loops - by j.crater - Oct-31-2018, 02:30 PM
RE: For \ While loops - by Itay - Oct-31-2018, 02:34 PM
RE: For \ While loops - by j.crater - Oct-31-2018, 02:38 PM
RE: For \ While loops - by Itay - Oct-31-2018, 02:49 PM
RE: For \ While loops - by j.crater - Oct-31-2018, 03:01 PM
RE: For \ While loops - by Itay - Oct-31-2018, 03:17 PM
RE: For \ While loops - by ichabod801 - Oct-31-2018, 03:20 PM
RE: For \ While loops - by Itay - Oct-31-2018, 03:27 PM
RE: For \ While loops - by ichabod801 - Oct-31-2018, 07:58 PM

Forum Jump:

User Panel Messages

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