PYTHON BASICS NOTES
1. What is Python?
Python is a high-level, easy-to-learn programming language used for web development, data
analysis, AI, automation, and more.
2. Features of Python
- Simple syntax (easy English-like statements)
- Interpreted language
- Free and open-source
- Cross-platform
- Large library support
3. Applications of Python
- Web development
- Data science
- Machine learning
- Automation scripting
- Game development
4. Variables
Variables store values.
Example:
x = 10
name = "Anusha"
5. Data Types
- int (10, 25)
- float (10.5)
- string ("Hello")
- bool (True / False)
6. Operators
- Arithmetic: + - * / %
- Relational: > < == !=
- Logical: and or not
7. Input and Output
name = input("Enter your name:")
print(name)
8. If Condition
if x > 10:
print("Greater")
else:
print("Smaller")
9. Loops
For loop:
for i in range(5):
print(i)
While loop:
i=1
while i <= 5:
print(i)
i += 1
10. Functions
def add(a, b):
return a + b
11. Lists
numbers = [1,2,3,4]
print(numbers[0])
12. Tuples
values = (10,20,30)
13. Dictionaries
student = {"name":"Anusha", "age":20}
14. File Handling
f = open("[Link]","w")
[Link]("Hello")
[Link]()
15. Conclusion
Python is powerful, beginner-friendly, and useful for many careers.
Practice daily to become confident in Python.