Professional Documents
Culture Documents
INDEX SECTION - A
S.NO 1. PROGRAM Write a statement for assigning the list (red, yellow)(orange, grey)(blue, green) to variable colors Extract the red color from the list colors Extract list (yellow (orange, grey)(blue, green)) from the list colors Extract yellow color from the list colors Extract (orange, grey) from the list colors Extract (blue, green) from the list colors For each color in the structure colors, write LISP code to extract that color from the list structure DATE SIGNA TURE
2. 3. 4. 5. 6. 7.
SECTION - B
8.
Program 1 to Program 24
Program 1 -
Write a statement for assigning the list (red, yellow)(orange, grey)(blue, green) to variable colors. Solution :- * (set 'colors `(red yellow ((orange)grey)((blue)green))) (RED YELLOW ((ORANGE) GREY) ((BLUE) GREEN))
Program 2 RED
Program 3 -
Extract list (yellow (orange, grey)(blue, green)) from the list colors. Solution :- * (cdr '(red yellow ((orange)grey)((blue)green))) (YELLOW ((ORANGE) GREY) ((BLUE) GREEN))
Program 4 YELLOW
Program 5 -
Program 6 -
For each color in the structure colors, write LISP code to extract that color from the list structure.
((blue)green)))))) (ORANGE) (d) * (cdr (car (cdr (cdr'(red yellow((orange)grey) ((blue)green)))))) (GREY) (e) * (car (car (cdr (cdr (cdr'(red yellow ((orange)grey) ((blue)green))))))) (BLUE) (f) * (cdr (car (cdr (cdr (cdr'(red yellow((orange)grey) ((blue)green))))))) (GREEN)