Scheme: Difficult Solutions
Write a function in scheme that takes in a nested python structured addition expression and turns it into a nested scheme structured addition expression.
> (python_to_scheme '(1 + (2 + 4)))
(+ 1 (+ 2 4))
(define (python-to-scheme exp)
(cond ((list? (car exp)) (python-to-scheme (car exp)))
((null? (cdr exp)) (car exp))
(else (cons (car (cdr exp)) (cons (car exp) (cons (python-to-scheme (cdr (cdr exp))) nil))))))