Write Python3 code to demonstrate to create a substring from string


Topic: Write Python3 code to demonstrate to create a substring from string

Solution

ini_string = 'xbzefdgstb'
print ("initial_strings : ", ini_string) 
sstring_alt = ini_string[::2] 
sstring_gap2 = ini_string[::3] 
print ("print resultant substring from start", sstring_alt) 
print ("print resultant substring from end", sstring_gap2) 



List all Python Programs