Message Boards Message Boards

0
|
3890 Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

[?] Create a new list?

Dear all,

I have a list (for example):

List={{{a, b, c},d},{{e, f, 
   g}, 
  h}, {{i, j, 
   k}, m}}

Is there any way that I can generate a new list as following :

NewList={{{a, b, c}->d},{{e, f, 
   g}-> 
  h}, {{i, j, 
   k}-> m}}

Thanks

POSTED BY: M.A. Ghorbani
4 Replies

@M.A. Ghorbani you have been with the forum for a while already and you ignoring the rules: https://wolfr.am/READ-1ST

The rules explain how to format your code properly. If you do not format code, it may become corrupted and useless to other members. Please EDIT your posts and make sure code blocks start on a new paragraph and look framed and colored like this.

int = Integrate[1/(x^3 - 1), x];
Map[Framed, int, Infinity]

enter image description here

POSTED BY: Moderation Team

Dear Sander and Neil,

Thank you very for your help.

Kind Regards,

POSTED BY: M.A. Ghorbani

just do:

Rule @@@ list
POSTED BY: Sander Huisman
list={{{a, b, c},d},{{e, f, g}, h}, {{i, j, k}, m}}
Map[Rule[#[[1]], #[[2]]] &, list]

Note List cannot be capitalized.

POSTED BY: Neil Singer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract