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

```
'world'  =>  'dlrow'
```

Difficulty: introductory

Starter code:

def solution(string):
	

Solutions:
def solution(str):
  return str[::-1]

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

def solution(string):
    # Pythonic way :)
    return string[::-1]
    
    # For beginners it's good practise 
    # to know how reverse() or [::-1]
    # works on the surface
    #for char in range(len(string)-1,-1,-1):
        #return string[char]


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


solution = lambda s: s[::-1]

def solution(string):
    newstring = ""
    letter = len(string) - 1
    for x in string:
        x = string[letter]
        newstring = newstring + x
        letter = letter -1 
    return newstring


def solution(string):
    temp = list(string)
    temp.reverse()
    return ''.join(temp)

def solution(string):
    return ''.join(i for i in reversed(string))

def solution(string):
   one_string_list=list(string)
   one_string_list.reverse()
   return''.join(one_string_list)


def solution(string):
    s1=''
    for x in string:
        s1= x+s1
    return s1 

def solution(string):
    s = list(string)
    j = len(s)-1
    for i in range(len(s)):
        if (i<j):
            s[i], s[j] = s[j], s[i]
            j = j-1
        else:
            continue
    s1 = ''.join(s)
    return s1

def solution(string):
    charlist = []
    res = ""
    for l in string:
        charlist.append(l)
    charlist.reverse()
    for c in charlist:
        res=res+c
    return res

solution = lambda x:x[::-1]

def solution(string):
    new_string = ""
    length = len(string)
    for i in range(0, length):
        new_string += string[length-1-i]
    return new_string

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


def solution(string):
  return string[::-1]
  
# ok znam z poprzednich lekcji


def solution(string):

    lst = []
    count = 1

    for i in range(0,len(string)):

        lst.append(string[len(string)-count])
        count += 1

    lst = ''.join(lst)
    return lst



solution=lambda _:_[::-1]    

def solution(string):
    if len(string) == 5:
      return string[4] + string[3] + string[2] + string[1] + string[0]
    if len(string) == 4:
      return string[3] + string[2] + string[1] + string[0]
    if len(string) == 3:
      return string[2] + string[1] + string[0]
    if len(string) == 2:
      return string[1] + string[0]
    if len(string) == 1:
      return string[0]
    if len(string) == 0:
      return ""
    pass

def solution(string):
    y = ""
    for i in string:
        y = i+y
    return y

solution=lambda s:s[-1::-1]

def solution(string):
    reverse = ""
    for i in string:
        reverse = i + reverse
    return reverse

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

def solution(string):
    result = ''
    for chr in string:
        result = chr + result
    return result


print(solution('world'))

def solution(string):
#     return string[::-1]
    s = ''
    for i in string: 
        s = i + s
    return s 

solution = lambda string: string[::-1] #I do Lambda -Mr. Stupido

def solution(str):
    return ''.join(reversed(str)) #[::-1] a little faster

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

def solution(string):
    word=''
    for letter in reversed(string):
        word+=letter
    return word

def solution(string):
    return ''.join(reversed(string))


def solution(string):
    out = []
    for i in string:
        out.insert(-1-string.index(i),i)
    return ''.join(out)

def solution(string):
    #string = "".join(reversed(string))
    return "".join(reversed(string))

def solution(string):
    s = list(string)
    l = list(reversed(s))
    return(str("".join(l)))
    pass

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

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

def solution(string):
    x = list(string)
    y = x.reverse()
    z = ''.join(x)
    return z



#1 technique using replace
def solution(string):
    
    # feed string characters in reverse, see for loop below
    stringReversal=[]
    # will hold final reverse string
    somaReverseString = ''
    
    for i in range(len(string)):
        # replace the forward character order in reverse 
        migratingCharacter = string.replace( string[i], string[-i-1])
        # append the newly replaced character to stringReversal 
        # captures reverse ordering
        stringReversal.append(migratingCharacter[i])
        # undo the replacement, to prevent copying over the original string
        string.replace( string[i], string[-i-1])
    
    # now stringReversal holds the string characters in reverse, as list items
    
    for i in stringReversal:
        somaReverseString += i
    return somaReverseString


#2 more direct proof, skips the replace, 
#feeds reverse ordering directly to the list
def solution(string):
    strings = []
    soma =''
    stringLengthRange = list(range(len(string)))
    for i in stringLengthRange:
        # index from start is 0, index from end is -1, -
        # - 1 from stringLengthRange offsets this
        strings.append(string[-i-1])
    for i in strings:
        soma += i
    return soma




# 3 here is the index-slicing one-liner
def solution(string):
    return string[::-1]


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

mytxt1 = solution("")

print(mytxt1)



                       


def solution(string):
    v = ''
    for i in reversed(string): v += i
    return v

def solution(string):
    reverse = ''
    for x in range(len(string)-1, -1, -1):
        reverse += string[x]
    return reverse

def solution(string):
    #reverse the string using indexing and negative steps
    return string[-1::-1]

def solution(word):
   reversed = word[-1::-1]
   return reversed


def solution(string):
    output = ""
    for i in string:
        output = i + output
    return output

def solution(string):
    # use the built-in list as a stack
    res = ''
    flip = list(string)
    
    # while the stack has elements
    while len(flip) > 0:
        # pop and append to result
        res += flip.pop()
        
    return res

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

def solution(string):
    if string==None:
        return("")
    else:
        x=string[::-1]
    return("{}".format(x))

def solution(string):
    length = len(string)
    reverse = ""
    x = 0
    for y in string:
        length = length - 1
        reverse = reverse + string[length]
        x=x+1
    return reverse;
    pass

def solution(string):
    length = len(string)
    rstring = string[length::-1]
    return rstring

def solution(word):
    newword = ''
    for letter in word:
        newword = letter + newword
    return newword

def solution(string):
    words = string.split(' ')
    reverse_sentence =''.join(reversed(string))
    return reverse_sentence


def solution(string):
    #checks if it one char or less and returns the value if so 
    if (len(string) <= 1):
        return string
    #reverse the string using a slide statement that starts at the last element to the first and iterates -1
    else:
        string = string[::-1]
        return string

def solution(string):
    d=''
    for i in string:
        d=i+d
    return d

def solution(string):
    i = len(string) - 1
    new = string[i::-1] 
    
    return new

def solution(string = ""):
    newstring = ""
    for x in string:
        newstring = x + newstring
    return newstring

def solution(string):
    a=string[::-1]
    return a
solution('world')

def solution(string):
    new_string = ''
    for char in string[ : :-1]:
        new_string += char
    return new_string

def solution(Word):
    reverse = Word[::-1];
    return reverse 

def solution(string):
    return_string = ''
    if len(string) > 0:
        for letter_index in range(len(string)):
            return_string = string[letter_index] + return_string
    return return_string

def solution(string):
    aux = ''
    for i in range(len(string)):
        aux += string[len(string) - i - 1]
    return aux

def solution(string):
    aux = []
    for i in range(len(string)):
        aux.append(string[len(string) - i - 1])
    return ''.join(aux)

def solution(string):
    string2 = ''
    for x in range(0,len(string)):
        string2 += string[len(string)-x-1]
    return(string2)

def solution(string):
    phrase = ''
    index = len(string) - 1
    
    for x in string:
        x = string[index]
        phrase += x
        index = index - 1
    return phrase

def solution(string):
    return string[::-1] #reverse the string backwards
    
    my_string = solution('Hello World!') #call the function with string of your choice
    
    print(my_string) #print the result


def solution(string):
    str_new = str("")
    for x in string:
        str_new = x + str_new
    print (str_new)
    return str_new
    pass
    


def solution(string):
    i = -1
    
    backwards = []
    
    #loop through and add the letters backwards to a list
    while i >= -1 * len(string):
        backwards.append(string[i])
        i -= 1
    #return the list all joined back into a string
    return(''.join(backwards))
    


def solution(string):
    #turn string to list
    list1 = list(string)
    #reverse list   
    reverse1 = reversed(list1)
    #returned list to string with join
    reversed_string = ''.join(reverse1)
    return reversed_string

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

print(solution('ambulance'))

def solution(string):
   
        array = list(string)
        array.reverse()
        output = ''.join(array)
        return output
    


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

def solution(string):
    reverse = []
    for char in string:
        reverse.insert(0, char)
    return ''.join(reverse)


def solution(string):
    new_str = ""
    lnum = len(string)
    for i in range(lnum):
        new_str = new_str + string[lnum-i-1]
    return new_str

def solution(string):
    list1 = list(string)
    list1.reverse()
    string = ''.join(list1)
    return(string)

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


def solution(string):
    pass
    index = len(string)
    rev = ""
    while index > 0 :
        rev += string[index - 1]
        index = index - 1
    return (rev)

def solution(string):
    len_str = len(string)
    reverse = []
    while len_str > 0:
        reverse += string[len_str - 1]
        len_str -= 1
    reverse_str = "".join(reverse)
    return reverse_str

def solution(string):
    index=len(string)-1
    str=""
    while index >= 0:
        str=str+string[index]
        index=index-1
    return str


def solution(str):
    str=''.join(reversed(str))
    return str
    pass

def solution(word):
    reversed_word = ""
    for letter in reversed(word):
        reversed_word += letter
    
    return reversed_word

def solution(string):
    a = list()
    for i in string:
        a.append(i)
    a.reverse()
    c = str()
    for v in a:
        c = c + v
    return c

def solution(string):
    #Empty string for holding reversed string
    reverse = ""
    letter_index = len(string)-1
    #Loop through for each letter
    for x in range(len(string)):
        #The reverse string gets the end letter added to it and then the next earlier one
        reverse = reverse + string[letter_index]
        #Move to next letter
        letter_index-=1
    return reverse

import string
def solution(string):
    s = string[::-1]
    return s

def solution(string):
    val = list(string)
    val.reverse()
    return ''.join(val)

    


def solution(string):
    stroka = "".join(reversed(string))
    return stroka

def solution(x):
    return x[::-1]
txt = solution("world")
print(txt)

def solution(string):
    word=''
    for i in range(-len(string),0):
        word=string[i]+word
    return word

def solution(string):
    
    a = list(string)
    
    for i in range(len(a)//2):
        if len(a) == 0 or len(a) == 1:
            break
        else:
            tmp = a[i]
            a[i] = a[len(a) - 1 - i]
            a[len(a) - 1 - i] = tmp
            
    return ''.join(a)
pass

def solution(string):
    pass
    negcount=-1
    solstring=""
    for i in range(len(string)):
        solstring+=string[negcount]
        negcount=negcount-1
    print(solstring)
    return(solstring)


def solution(string):
    return string[::-1]
print(solution('however'))

def solution(string):
    rev = ''
    for i in range(len(string)):
        rev += string[len(string) - i - 1]
    return rev

def solution(string):
    new_word = ''
    while string != '':
        new_word += string[-1]
        string = string[0:-1]

    return new_word

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

a = "mortiitei"
print(solution(a))

def solution(string):
    reverse=''
    for i in range(len(string)):
        
        #this won't work because strings are immutable
        #reverse[i]=string[-i]
        
        #however, you can assign each character to a string
        reverse=reverse+string[-i-1]

    return reverse

def solution(string):
    return string[::-1]
    
solution('hello, world!')

def solution(string):
    forwardCharArr = list(string)
    backCharArr = []
    
    for i in range(len(string)-1, -1, -1):
        backCharArr.append(forwardCharArr[i])
        
    reverseWord = ''.join(backCharArr)
    return reverseWord

def solution(zin):

    reversedArgs = zin[::-1]
    return reversedArgs

def solution(string):
    return ''.join([s for s in reversed(string)])

def solution(string):
    
    if len(string)==0:
        return ""
    else:
        li=[]
        for i in range(len(string)-1,-1,-1):
            li.append(string[i])
        
        sort = "".join(li)
        return sort
        


def solution(string):
    a = [0 for i in range(len(string))]
    i = len(string)-1
    for char in string:
        a[i]=char
        i-=1
    return "".join(a)

def solution(string):
#     pass
    print(string[::-1])
    return string[::-1]

def solution(string):
    string_length=len(string)
    reversed_string=string[string_length::-1]
    return reversed_string