user
Construct an algorithm to reverse a given input string, character by character.

Input String: Hello World


assistant
def reverseString(str): 
    reversedStr = [] 
    length = len(str) 
  
    for i in range(length - 1, -1, -1): 
        reversedStr.append(str[i]) 
        
    return "".join(reversedStr) 

print(reverseString("Hello World"))