Python Forum
Need guidance on String indexing
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need guidance on String indexing
#4
Add-on way to think: how many characters should slice [2:4] return? 4 - 2 = 2 (it’s always stop- start = number of elements). If first is included then last should be excluded in order to get right number of characters.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
Need guidance on String indexing - by Gateux - Jun-22-2019, 10:38 AM
RE: Need guidance on String indexing - by Yoriz - Jun-22-2019, 11:00 AM
RE: Need guidance on String indexing - by perfringo - Jun-22-2019, 12:44 PM

Forum Jump:

User Panel Messages

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