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 107 views
1 answer 122 views
1 answer 120 views
1 answer 116 views
1 answer 108 views
...