2
$\begingroup$

As you see both inputs below give the same results. Is there any reason to use List[3] instead of just 3 in the first case?

Table[1,{3}]
(* {1,1,1} *)

Table[1,3]
(* {1,1,1} *)
$\endgroup$
2
$\begingroup$

If you're before v10.3, then only the first syntax is correct. For more information check:

Why does Table behave differently in Mathematica compared to WolframCloud?

BTW this syntax change causes problem in certain cases:

Unexpected behaviour from Table[]

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.