String Index

content = """Toronto is the provincial capital of Ontario and the most populous city in Canada, 
with a population of 2,731,571 in 2016. Current to 2016, the Toronto census metropolitan area (CMA), 
of which the majority is within the Greater Toronto Area (GTA), held a population of 5,928,040, 
making it Canada's most populous CMA."""
content
"Toronto is the provincial capital of Ontario and the most populous city in Canada, \nwith a population of 2,731,571 in 2016. Current to 2016, the Toronto census metropolitan area (CMA), \nof which the majority is within the Greater Toronto Area (GTA), held a population of 5,928,040, \nmaking it Canada's most populous CMA."

Get first 50 chars

content[:50]
'Toronto is the provincial capital of Ontario and t'

Get last 50 chars

content[-50:]
" 5,928,040, \nmaking it Canada's most populous CMA."

String reverse

city = 'Toronto'
city
'Toronto'
city[::-1]
'otnoroT'