Ad
Fundamentals
Strings
Code
Diff
  • def reverse_string(n):
        return n[::-1]
    
    • def reverse_string(n):
    • if n == '':
    • return ''
    • return reverse_string(n[1:]) + n[0]
    • print(reverse_string('hello world'))
    • return n[::-1]