What is the correct code to change the standard boolean ‘true’ to for exemple ‘left’ or ‘well done’ or …
So instead of giving ‘true’ when an expression is true, it has to give ‘left’ for exemple.
Thanks.
What is the correct code to change the standard boolean ‘true’ to for exemple
Share
A
booleanvalue can only be set totrueorfalse. However, you can use that boolean value to determine other variables’ values.You can use the ternary operator
(expr) ? (value if true) : (value if false), which operates on boolean expressions: