Operators
Operators are special symbols that are used to perform operations on values and variables. There is types to it;
1.Arithmetic which perform mathematical calculations that includes addition (+), division (/), multiplication (*).
- Comparison which compares two values and often return a boolean result, the true or false ones. Example (==) equal to, (!=) not equal to, greater than (>).
- Logical combines conditional statements like and, or, not.
- Assignment assigns values to variables an includes, =, +=.
Conditionals
After using operators, there comes conditionals statement that tells python what to do next. Example is if, elif and else.
If returns a logic and when evaluated depending with what you want to be returned, the rest is skipped. For example; what we have here is if a student has a laptop then the output is yes and if no then the answer is skipped. It returns the_ TRUE_.
Elif
Elif if the short form of else if and is the opposite of if where when the condition before was if and it returns False, and elif returns it as True then the rest is skipped. Example
Else now is the last condition that when ran it runs when the if and elif returns false. Example
Conclusion
Operators produce value and conditional are the statements. Once you look at it like that then it will be easier to understand what you want to write up.







Top comments (0)