string = input('enter a string: ')
def reverseString(string):
out = ""
for i in range(len(string)-1,-1,-1): #Explanation of why "3" -1 at the end
out += string[i]
return out
print(reverseString(string))
#The first argument is len(string)-1.
#This is the starting point of the loop.
#Since we want to iterate through the characters of the string in reverse order, we start at the last index of the string, which is len(strr)-1.
#The second argument is -1.
#This is the endpoint of the loop.
#Since we want to iterate through all the characters of the string in reverse order, we end at the first index of the string, which is -1.
#The third argument is -1.
#This is the step size of the loop.
#Since we want to iterate through the characters of the string in reverse order, we decrement the index by 1 in each iteration.