picked up Mathematica (transitioning from Python) a couple of days ago so forgive me for the newbie question. I'm trying to create a function which takes in a list of numbers and returns a list of the permutations of the number formed by the concatenation of those numbers. To be more clear ->
foo({1,2,1}) would output {121, 112, 211}. This is how I've tried to implement it.
my_function[x_] := FromDigits /@ Permutations[x]
Thinking that as long as the user input was a list like {1,2,3} this would work just fine. It doesn't seem to, so then I tried
my_function[x_,y_,z_] := FromDigits /@ Permutations[{x,y,z}]
This also didn't work.
This isn't the first time I've had trouble getting function definitions to work. What is it about my function definitions in this case that is causing them not to work?
Also - I've gone through the fast introduction for Python programmers. Any other recommended newbie resources?
Thanks
my_functiontofunctionand it will work. – mikado May 21 '19 at 20:23