simplest way to reverse solution in Clear category for Backward String by Ajbek_Toroev
def backward_string(val: str) -> str:
# we could use looping through each charachter and other approaches but the best and simplest way is this
if __name__ == '__main__':
# These "asserts" are used for self-checking and not for an auto-testing
assert backward_string('val') == 'lav'
assert backward_string('') == ''
assert backward_string('ohho') == 'ohho'
assert backward_string('123456789') == '987654321'
print("Coding complete? Click 'Check' to earn cool rewards!")
May 22, 2020