Skip to content

Latest commit

 

History

History
47 lines (27 loc) · 523 Bytes

Reversed_Strings.md

File metadata and controls

47 lines (27 loc) · 523 Bytes

CodeWars Python Solutions


Reversed Strings

Complete the solution so that it reverses the string value passed into it.

solution('world') # returns 'dlrow'

Given Code

def solution(string):
    pass

Solution 1

def solution(string):
    return string[::-1]

Solution 2

def solution(string):
    return "".join([l for l in string][::-1])

See on CodeWars.com