Quick actions

cmd+k|ctrl+k

Navigation

Languages

Reverse word

Snippet info

Language

Python

Visibility

public

Author

santhosh136

Created

2020-08-31T12:51:55Z

Updated

2020-08-31T12:51:55Z



def reverse(s:str) -> str:
    c = list(s)
    for i in range(int(len(c)/2)):
        c[i],c[len(c)-1-i] = c[len(c)-1-i], c[i]
    return ''.join(c)

s = "santhosh"
print(reverse(s))
INFO