Answer:
The function in Python is as follows:
def reverse(inputstr):
outputstr = ""
for i in inputstr:
outputstr = i + outputstr
return outputstr
Step-by-step explanation:
This defines the function
def reverse(inputstr):
This initializes the output string
outputstr = ""
This iterates through the input string
for i in inputstr:
This generates the output string by reversing the input string
outputstr = i + outputstr
This returns the reversed string
return outputstr