Created reverse.py. Included test cases.