Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

negative indexing in python

b = "Hello, World!"
print(b[-5:-2])

#Get the characters:
#From: "o" in "World!" (position -5)
#To, but not included: "d" in "World!" (position -2):
#b = "Hello, World!"

#please like and follow if helpful 
 
PREVIOUS NEXT
Tagged: #negative #indexing #python
ADD COMMENT
Topic
Name
1+2 =