Dec-02-2017, 03:10 PM
Hi Viewer,
Just started learning to code in Python. Was going thru some code online on reversing a string. The code is as follows:
s = "Hello"
print(s[::-1])
Could not understand the underlying logic behind this? Is this something builtin which Python by default understands like for instance s[::] would print the complete string. Please clarify.
Thanks,
Kiran.
Just started learning to code in Python. Was going thru some code online on reversing a string. The code is as follows:
s = "Hello"
print(s[::-1])
Could not understand the underlying logic behind this? Is this something builtin which Python by default understands like for instance s[::] would print the complete string. Please clarify.
Thanks,
Kiran.