![]() It works equally well with strings and numbers, but beware - the character "2" is not equal to the number 2. Is is a logical operator that's short for 'equals.' Just as + adds the two numbers on each side of it, is compares two values on each side and evaluates to true or false depending on whether they're identical. An expression that evaluates to "true" or "false" is called a condition Much as how arithmetic involves manipulating numbers with addition, multiplication and such, logic involves manipulating the values "true" and "false" using its own operators. Strings of Text #Ī string is a bunch of characters strung together, demarcated by matching pairs of either double or single quotes.Ĭomputers can perform more than just mathematical tasks - they are also virtuosos in classical logic. This ability to simplify rising sequences allows to perform some otherwise complicated calculations easily. that is, a constantly looping sequence. Starting with a sequence of numbers: 0, 1, 2, 3, 4, 5, 6., and did % 3 to each of them, they would become 0, 1, 2, 0, 1, 2, 0. ![]() Modulo may seem somewhat obtuse an operator. Can also be used to negate a number.īrackets/parentheses (causes an expression to be evaluated earlier). Sub-expressions together and force them to be evaluated first with parentheses. The computer follows the normal order of operations in mathematics: first multiplying and dividing, then adding and subtracting. Treating Numbers and Strings as Conditions
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |