Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.9K Views
|
1 Reply
|
1 Total Like
View groups...
Share
Share this post:

Writing a function that will take lists and return the list lengths?

Posted 9 years ago
POSTED BY: Brandon Davis
Posted 9 years ago

Since you want to "do the same thing to every item in a sequence of items", perhaps think "Map", but your input isn't a list so add a layer of {} to make it into a list

findlength[x___] := Map[Length, {x}]
findlength[{x, y, z}, {4, 2}]
POSTED BY: Bill Simpson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard