Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python get substring

my_string = "I love python."

# prints "love"
print(my_string[2:6])

# prints "love python."
print(my_string[2:])

# prints "I love python"
print(my_string[:-1])
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #python #substring
ADD COMMENT
Topic
Name
5+4 =