I want to reverse a string without slicing it but only using reverse function. So how can I use reverse function to reverse a string?
You cannot use reverse() or reversed() function to reverse the string directly ,but can can reverse the string using reversed() and join() ,here is an example.
>>> st='Text!' #text to be reversed
>>> s=''
>>> s.join( reversed(st) )
'!txeT'
The 'text!' is reversed.