Python does not support a character type; these are treated as strings of length one, thos also considered a substring.<\/p>\n
To access substrings, use the square brackets for slicing along with the index or indices to obtain your substring.<\/p>\n
\u00a0 \u00a0 \u00a0Example:<\/p>\n
var1= “Hello World”<\/p>\n
print (“var1[0]:”, var1[0])<\/p>\n
\u00a0 \u00a0 \u00a0When the above code is executed, it produces:<\/p>\n
var1[0]: H<\/p>\n
Gilberto Rogel Garc\u00eda<\/p>\n
For more info visit:This link<\/a><\/p>\n #mastery<\/a>26<\/p>\n #TC<\/a>1014<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":" Python does not support a character type; these are treated as strings of length one, thos also considered a substring.<\/p>\n To access substrings, use the square brackets for slicing along with the index or indices to obtain your substring.<\/p>\n Example:<\/p>\n var1= “Hello World”<\/p>\n print (“var1[0]:”, var1[0])<\/p>\n When the above code is executed, it produces:<\/p>\n var1[0]: H<\/p>\n Gilberto Rogel García<\/p>\n For more info visit:This link<\/a><\/p>\n