I’m looking to take in a list with strings and numbers, such as
'("Ben" 95 99 100 -1 "Bob" 90 40 66 -5 "Jerry" 95 90 0)
and return the list with all negative numbers removed and the name and its subsequent number values place inside of a list within that list – for my example, the wanted return value would be
(("Ben 95 99 100) ("Bob" 90 40 66) ("Jerry" 95 90 0))
I can’t get it to place the parentheses in the right places, and I’m wondering how this can be done. Can anyone help?
Try this:
When tested with the sample input provided:
The returned value is as expected: