Ad
Fundamentals
Strings
Code
Diff
  • def reverse_string(string):
        return string[::-1]
    • reverse_string = lambda n:n[::-1]
    • def reverse_string(string):
    • return string[::-1]
Code
Diff
  • def test():
        words = ['t', 'e', 's', 't']
        result = ''
        for word in words:
            result += word
        return result
    • def test() :
    • return "test"
    • def test():
    • words = ['t', 'e', 's', 't']
    • result = ''
    • for word in words:
    • result += word
    • return result
Code
Diff
  • def test():
        return "t"+"e"+"s"+"t"
    • def test():
    • return "t"+"e"+"s"+"t"
    • return "t"+"e"+"s"+"t"