Comments and operators in python.

  1.  Comments - It is type of logical notes which are not a part of of a code.
There are two types of comments -

  •      Single line comment - It is started with a symbol (#).  Example - # This is a comment.
Multi- line comments -   It is started by s triple quotes ("'......"').

2. Uses of comments -
  • It increases the readability of a code.
  • Re- using existing code.
Understanding code after long term use.

3. Operators- It is a particular symbol which is used to perform some operations with the help of operands.
Operands - A kind of data types used for calculations. It always exists with python operators.
  πŸ”₯ Operators may be unary, Binary, Ternary.
  • Operators with one operands is unary operator.  Example- ++a
  • Operators with two operand is called binary operators. Example- a+b
Operators with three operands is called ternary operators. Example a<b and a>b.
4. Classification of operators:-


a. Arithmetic operators :-  +, -, * , % .
b. Relational operators :-  == , != , < , >.
c. Logical operators :- not , and , or.
d. Assignment operators :- = , +=, -=, *=,,  etc .

  • And- yeh result ko true or false me answer karta hai. Jab koi operation k left aur right side true hota hai tabhi yeh true answer me batata hai varna false batata hai answer me
.O r- jab bhi koi bhi Operation ke right ya left side me agar true aa jata hai toh yeh true answer krta hai nhi toh false .
πŸ”₯And ya or me YHI aantar hai ki jab and true uss waqt deta hai jab dono side true ho . Aur or true us waqt deta hai jab ekk side bhi true aa  jate toh.

Comments

Post a Comment

Popular posts from this blog

ORGANIC CHEMISTRY

Character or Persanality