Your Handwritten Python Ch3 Notes Typed
Your Handwritten Python Ch3 Notes Typed
Handwritten Notes)
---
Example: 5 + 3, a * b
---
2. Comments
- Multi-line comments: triple single quotes ('''comment''') or triple double quotes ("""comment""")
---
---
4. Types of Operators
- Arithmetic Operators: +, -, *, /, //, %, **
---
5. Operator Precedence
1. Parentheses ()
2. Exponentiation **
3. Unary + and -
4. *, /, //, %
5. +, -
6. Relational operators
7. Logical not
8. Logical and
9. Logical or
---
6. Conditional Statements
if condition:
# code block
# true block
else:
# false block
if condition1:
# block1
elif condition2:
# block2
else:
# default block
---
7. Sample Programs
if num > 0:
print("Positive")
else:
print("Negative")
print("Even")
else:
print("Odd")
3. Grading system
print("Grade A")
print("Grade B")
print("Grade C")
else:
print("Fail")
---
8. Errors in Python
---