Skip to main content

Token (OPERATOR)

Operator: Operator are tokens that does computation(calculation) with designated or given values in expression. Operators when applied on operands form an expression.

Operand: Operand is the value or variable on which calculation is performed.

Operators are can be classified in three categorize:

1. Arithmetic Operator: Arithmetic operators are those operators which are used for arithmetic or mathematical calculations. In Python, the arithmetic operators are:

  1.  Addition (+) : It is used to sum two operands.
  2.  Subtraction (-) : It gives difference between two operands.
  3.  Multiplication ( * ) : It gives us product of the two operands.
  4.  Division (/) : It gives us Quotient of the two operands.
  5. Floor Division ( // ) : It gives us quotient of two operands(without fractional part).
  6. Modules ( % ) : It gives us integer remainder after division of 'a' by 'b' -(a % b).
  7. Exponent ( ** ) : It gives us product of 'a' by itself  'b' times(a to the power of b).

2. Relational Operator : Relational operators are those operators which are used to compare aarithmatical and logical expressions. It is also known as ' Comparison Operator'.

  1. Greater than(>) : Gives result true if the left operand is greater than the right operand.
  2. Less than (<) : Gives result true if the left operand is less than the right.
  3.  Equal to (= =) : Gives result true if both operand are equal.
  4.  Not Equal to (!=) : Gives result true if both operand are not equal.
  5. Greater than/Equal to ( >=) : Gives result true if left operand is greater than or equal to the right operand.
  6. Less than/ Equal to (<=) : Gives result true if the left operand is less than or equal to the right operand.

3. Logical operator : Logical operators are used when there is a situation for evaluating two or more relational expressions. In python, there are three logical operators are commonly used:

    1. Logical AND (and) : this operator is written as 'and'. It combines two expression into one. The resulting expression evaluates to 'True' only if both the conditions satisfies to 'true'.

    


     2. Logical OR (or) : This operator is written as 'or'. It combines two expressions into one. The resulting expression evaluates to 'True' when either of the conditions satisfies to 'True'.

                                            


     3. Logical NOT (not) : This operator is written as 'not'. It works with single expression or operand. it is a unary operator. This operator negates or reverse the truth value of the expression. In other words, if the expression is 'true', then the use of 'not' expression makes it 'False' and vice versa.

                                        



Comments

Post a Comment

Popular posts from this blog

ARITHMETIC OPERATIONS ON BINARY NUMBER

Binary arithmetic is simpler to learn because binary number system deals with only two digits - 0 and 1. Binary number perform all arithmetic operation such as Addition, Substraction, Multiplication and compliment as in decimal number system. Binary Addition The addition table for binary arithmetic consist of only the following four entries: 0+0=0 0+1=1 1+0=1 1+1=0 , plus a carry of 1 to the next column.     1011        + 1100    10111     1100    + 1100     11000 Binary Substraction There are three ways to do substraction between binary numbers:- 1. Simple Substraction 2. Substraction using 1's Complement 3. Substraction using 2's Complement Simple Substraction: The complete table of binary substraction is as follows: 0-0=0 0-1=1, borrow 1 from next column 1-0=1 1-1=0    1101 - 0101   1000     1001   - 0111    0...

Media Of Communication Part 2

Unguided Media Unguided media transport electromagnetic wave without using a physical connection. This type of communication referred as wireless communication. We can divided wireless transmission in :-   1. Radio Wave:- Electromagnetic   waves ranging in frequencies between 3KHz and 1GHz are normally called radio wave.   On radio wave connectivity used communication used Bluetooth, Wi-Fi, etc.     Bluetooth :- It is a wireless network connectivity that enables to connect or transfer data between devices over a short range the physical range of connection up to 100 meter. Ex- Mobile phone, barcode scanning, portable speaker, wireless keyboard, mouse etc.      Wi-Fi (Wireless Fidelity):- Wi-Fi is a network of wireless connection. Wi-Fi network establish by radio frequency like Bluetooth, but has more power, resulting a strong connection.    ·   Wi-Fi is also called wireless Ethernet. It has connectivity range up...

WEB SERVICES

INFORMATION RETRIEVAL   It is the process of accessing information that is stored on the Internet. The process of exploring and retrieving the information from the Internet is known as net surfing. When your PC is connected to the Internet, you are ready to retrieve information from it. You need a particular software called Web browser to retrieve information.   When you type the URL of a particular Website in the address bar of the Web browser and press Enter key, the browser retrieves the Web page from the Internet and stores its content. SEARCH ENGINE   It is a Website that provides the required data on specific topics. It turn the Web into a powerful tool for finding information on any topic. Search engine allows users to enter keywords (queries or terms) related to particular topics and retrieve information about the Websites containing these keywords. It is a program designed to search for information on the Web through a database of Web pages queries or keywords....