Monday, 9 September 2013

Removing strings from lists and removing numbers from lists

Removing strings from lists and removing numbers from lists

(define p1 '(4 "the" "dog" "chewed" "the" "rug"))
(define p2 '(79 "on" "the" "rug" "slept" "the" "dog"))
(define p3 '(32 "the" "rug" "rats" "slept" "on"))
(define p4 '(42 "the" "meaning" "of" "life"))
Given lists p1-p4 I want to write a function called get-page-number that
would pull out the number from the list. Examples:
(get-page-number p2) would give 79
Then I need to write a function called get-words that would get rid of the
number and return the strings. Example:
(get-words p1) would give "the" "dog" "chewed" "the" "rug"

No comments:

Post a Comment