Can anyone briefly explain these to me <= >= == =+ Thanks very much
um is the question asking equal to or greater than then i might be able to explain it.
< with a line under it could mean it could be the same number or or less than. ex: 6<6, 7, 8, ect...
srry if i read the question wrong
In order: less than or equal to greater than or equal to equal to (because = is the assignment operator) add to (x+=2 is a quicker way of writing x=x+2)
The last one is actually written +=.
These are all great answers. To delve into it a little more: The first three: <=, >=, == are comparison/relational operators. Basically, they compare what is before the symbol to what comes after and are usually used to return a boolean (True or False). Example: if (x >= y) // assume x and y are integers. This line asks if the value of x is equal to or greater than the value of y. /*code goes here*/ //if x is greater than or equal to y then do this line of code. (if x >= y was True) else /*different code here*/ //this line of code would be called if x is less than y. (if x >= y was False) The =+ should be written += and works as Morewrite mentioned above.
I find all answers very helpful. appreciate allot
yw
Join our real-time social learning platform and learn together with your friends!