1
$\begingroup$

If I have

{x->2,y->3,z->19} 

and make many calculations and finaly get

First/@FactorInteger[57]

{3, 19}

how can I apply the inversed rules to get

{y,z}

without using

/.{2->x,3->y,19->z} 
$\endgroup$
  • 2
    $\begingroup$ Why wouldn't {3, 19} /. Map[Reverse, {x -> 2, y -> 3, z -> 19}] work? $\endgroup$ – J. M. will be back soon May 11 '17 at 0:48
  • $\begingroup$ it worked!thanks $\endgroup$ – J42161217 May 11 '17 at 0:55
  • 4
    $\begingroup$ @Jenny_mathy You can also write Reverse[rules, {2}] $\endgroup$ – Coolwater May 11 '17 at 4:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.