Hello everyone! I would like to ask you two questions regarding strings which I do not know. Excuse me in advance if the questions may seem a bit dumb. I'm a beginner. So let's get back to the point, this is my string:<br>
<br>msg= 'Hello world'<br>If I do, msg[:3] I get the following output, 'Hel'<br>If I do, msg[6:] I get the following output, 'World'<br>Ok, so I understand why this is happening. What I do not understand is why I get the following output in this cases.<br>
<br><br>1) msg[:-1] which has the output 'Hello Worl'<br>2) msg[0:6:2] 'Hlo'<br>3) msg[::-1] 'dlroW olleH' <br><br>Can someone please explain this to me? Thank you so much and I wish everyone a great day!<br>