string_manipulation_accessing.py


Sign up Free. Don't forget to check out our challenges, lessons, solve and learn series and more ...


Code Snippet

name="Mr Moose"
print(name[2:5]) #starts at the 2nd character and up to the 5th char (not including index 05)
print(name[1]) #prints the character held in index 01
print(name[1:5]) #prints from the 1st character up to the 5th (not including the 5th)



                    

Try it yourself