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


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

Solution

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



List all Python Programs