How to use 'how to print reverse string in python' in Python

Every line of 'how to print reverse string in python' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
15def reverse_str(string):
16 rev_list=[]
17 new_list=list(string)
18 while new_list:
19 rev_list += new_list[-1]
20 new_list.pop()
21 return ''.join(rev_list)

Related snippets