How to get a substring between two indexes of a string in Python

1 Answer

0 votes
s = "Python Programming"

start_index = 3
end_index = 11

substring = s[start_index:end_index]

print(substring)  



'''
run:

hon Prog

'''

 



answered Dec 16, 2024 by avibootz

Related questions

1 answer 210 views
1 answer 206 views
1 answer 209 views
1 answer 201 views
1 answer 206 views
...