Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Here's one way to display the even numbers from a sequence of 10 values in LISP:

(let ((numbers '(1 2 3 4 5 6 7 8 9 10)))
  (dolist (num numbers)
    (when (evenp num)
      (print num))))

This code starts by defining a variable called numbers and assigning it a list of integers from 1 to 10. Then, it uses the dolist function to iterate over each element in the list. For each element, it checks if it's even using the evenp function. If it is, it prints the number to the console using print.

This code should output the even numbers:

2
4
6
8
10