Coding Help Starting and Ending with a certain Character

When i try adding in what the examples give, the code just doesn't work either. Nothing prints and none of the algebra executes. Its very confusing.