Well it is a small function and simple in coding

but the only small tiny thing is that it will reverse words too

Update :

It reverses number also ur basic work is getting finished