Sep-07-2023, 01:43 PM
(Sep-07-2023, 01:42 PM)PythonBoy Wrote:(Sep-07-2023, 01:33 PM)DPaul Wrote: Hi, No loops allowed ? then try:
x = '1234321'
y = x[::-1]
Is y == x ?
Paul
Although this is not the way my teacher wants me to do it,
I am interested in this method also. Could you please explain why did we write y = x[::-1]?