Class 11 Notes Informatics Practices Chap 3
Class 11 Notes Informatics Practices Chap 3
CLASS 11TH
SUBJECT – INFORMATICS PRACTICES
CHAPTER- 3 BRIEF OVERVIEW OF PYTHON
1. Introduction to Python
• Python is a high-level, interpreted, and object-oriented programming language.
• Developed by Guido van Rossum and released in 1991.
• Python emphasizes code readability and provides constructs that allow for clear
programming on both small and large scales.
2. Features of Python
• Easy to learn and use: Python's syntax is clear and closer to human language.
• Interpreted Language: Python code is executed line-by-line, making debugging
easier.
• Dynamically Typed: No need to declare variable types, Python infers the type
automatically.
• Cross-platform compatibility: Python works on Windows, macOS, Linux, etc.
• Extensive Library Support: Python has numerous libraries for various tasks, such as
NumPy, Pandas, Matplotlib, etc.
• Open Source: Python is free to use and distribute.
• Object-oriented: Supports object-oriented programming, enabling encapsulation,
inheritance, and polymorphism.
6. Conditional Statements
• Python uses if, elif, and else for conditional execution.
Example:
python
x = 10
if x > 0:
print("Positive")
elif x == 0:
print("Zero")
else:
print("Negative")
7. Loops
• For loop: Used for iterating over a sequence.
• While loop: Used when a condition is to be checked repeatedly.
Example:
python
# For loop
for i in range(5):
print(i)
# While loop
i=0
while i < 5:
print(i)
i += 1
8. Functions
• Functions allow for reusability and better organization of code.
• def keyword is used to define a function.
Example:
python
def greet(name):
print("Hello", name)
greet("Alice")
Key Takeaways:
• Python is versatile and easy to use, making it suitable for beginners.
• Its extensive standard library supports a wide range of tasks, from web development
to data analysis.
• Python's simple syntax and dynamic typing enable quick development cycles.