Is there a way to multiply each value in a list, however instead of getting another list (2 4 6) like so, you get the multiplication of all values together.
(define (multi x y)
(if (null? y)
'()
(* x (car y))))
(multi 2 '(1 2 3))
2 * 1 * 2 * 3
==> 6
This may be very simple to some people, but I am having a coding block here, so please don't be rude in the comments. thank you.
(define (mult x lst)
(if (null? lst)
x
(mult (* x (car lst))(cdr lst))))