Python Forum
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
String Slicing
#4
(May-04-2017, 10:45 AM)Bass Wrote: The [start] 3 is counting from a position of 0 rather than 1

But the [stop] 7 is counting from 1 rather than 0

In the programming indexes are almost all of the time 0-based.
stop is counting from 0 too, however it's starting from (including) start index up to (but not including) stop index.
Reply


Messages In This Thread
String Slicing - by jack - May-04-2017, 09:52 AM
RE: String Operatoion - by buran - May-04-2017, 10:27 AM
RE: String Operatoion - by Bass - May-04-2017, 10:45 AM
RE: String Operatoion - by buran - May-04-2017, 10:52 AM
RE: String Operatoion - by buran - May-04-2017, 10:56 AM
RE: String Operatoion - by Bass - May-04-2017, 10:56 AM
RE: String Operatoion - by volcano63 - May-04-2017, 11:16 AM
RE: String Operatoion - by buran - May-04-2017, 11:20 AM
RE: String Operatoion - by volcano63 - May-04-2017, 11:27 AM
RE: String Operatoion - by buran - May-04-2017, 11:36 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python3 string slicing Luchano55 4 661 Feb-17-2024, 09:40 AM
Last Post: Pedroski55
  Am I wrong or is Udemy wrong? String Slicing! Mavoz 3 2,639 Nov-05-2022, 11:33 AM
Last Post: Mavoz
  String slicing and loop iteration divyansh 9 4,841 Jun-07-2020, 10:29 PM
Last Post: divyansh
  String slicing divyansh 6 3,416 May-31-2020, 06:15 AM
Last Post: pyzyx3qwerty
  string slicing help oli_action 2 2,225 Mar-22-2020, 09:57 AM
Last Post: oli_action
  Accepting strings as arguments when slicing a string? (Ziyad Yehia on Udemy) Drone4four 4 3,837 Aug-23-2019, 07:59 PM
Last Post: Drone4four
  string slicing default value Uchikago 1 2,853 Jul-01-2019, 11:19 AM
Last Post: perfringo
  string slicing Uchikago 2 2,420 Jun-28-2019, 06:35 AM
Last Post: perfringo
  String slicing in python from reverse ift38375 1 2,430 Apr-29-2019, 06:58 AM
Last Post: perfringo
  String Slicing in List Comphrensions Patroclus72790 1 2,287 Mar-21-2019, 09:33 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

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