If lst is equal to '(a (b c) (d)), what is (car (cdr lst)) equal to:
(Select multiple correct answers)
a.(cadr lst)
b.'(d)
c.'((b c) (d))
d.'(b c)
e. (cdar lst)
a] (cadr lst) and e] (cdar lst)
car stands for the first element and cdr stands for the rest elements. So in the expression (car (cdr lst)), let's take the inside one (cdr lst). Here the elements except the first element of the list lst is obtained. That is cdr lst = a ( b c )( d )). Now car of this element is the first element that is "a". In the options (cadr lst) and (cdar lst) both are same and gives second element of the list lst as the output which is equal to "a".
Get Answers For Free
Most questions answered within 1 hours.