I read this. I did not understand what it meant. Could anyone expand on this. + What is the difference between = and ==.
"not is simply a negation of a condition. It will be inverted. True becomes false and false becomes true. e.g. (5 == 5) the result is true. At the condition not (5==5) we get false as result. "
You use the =
character to set variables. ==
basically means "check if equal". This will "return" either true or false.
a = 5 -- Set a variable -- b == 5 -> This is not correct and will result in a syntax error b = 5 a = (b == 5) -- This is correct though. It will set a to the result of (b==5). print(a) -- prints true, as b equals 5 b = 6 print(b == 5) -- prints false, as b equals 6. --You can find these statements too in "if - then constructions" if b == 5 then print("B equals 5!") else print("B does not equal 5!") end