2

I have the following code

test[variable_: 0] := Module[{},
   If[variable != True, Print["worked"]];
   ];

test2[variable_: 0] := Module[{},
   If[variable == True, Print["worked"]];
   ];

If I run

test2[True]

I get "worked" as I expect.

But if I run

test[] 

I return nothing. Why is this the case?

Tomi
  • 4,366
  • 16
  • 31

0 Answers0