Comments and operators in python.
- Comments - It is type of logical notes which are not a part of of a code.
- Single line comment - It is started with a symbol (#). Example - # This is a comment.
2. Uses of comments -
- It increases the readability of a code.
- Re- using existing code.
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
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.
Nice ππ
ReplyDelete