Python Full Notes (Beginner to Basic)
1. Introduction to Python
Python is a high-level, interpreted programming language used for building applications, websites, AI
2. Features of Python
- Easy to learn
- Simple syntax
- Platform independent
- Open source
- Large community
3. Variables
Variables store data.
Example:
name = 'Rahul'
age = 15
4. Data Types
int → 10
float → 3.5
str → 'Hello'
bool → True/False
5. Input and Output
name = input('Enter name: ')
print(name)
6. Operators
Arithmetic: + - * /
Comparison: == != > <
Logical: and or not
7. Conditional Statements
if, else, elif
Example:
if age >= 18:
print('Adult')
else:
print('Minor')
8. Loops
for loop:
for i in range(5):
print(i)
while loop:
i = 0
while i < 5:
print(i)
i += 1
9. Functions
Functions are reusable blocks.
Example:
def greet():
print('Hello')
greet()
10. Lists
List is a collection.
Example:
numbers = [1,2,3]
print(numbers[0])
11. Tuples
Immutable list.
Example:
t = (1,2,3)
12. Dictionaries
Key-value pairs.
Example:
d = {'name':'Rahul', 'age':15}
13. Strings
Text data.
Example:
text = 'Hello'
14. Basic Programs
Sum:
a=5
b=3
print(a+b)
Even/Odd:
if num%2==0:
print('Even')
15. Conclusion
Practice daily and build small projects to improve your Python skills.