Here’s a list of the basic/fundamental concepts of Python that every beginner should learn:
✅ 1. Python Syntax & Structure
-
How to write and run Python code
-
Indentation (very important in Python)
-
Comments (#
for single-line, ''' '''
or """ """
for multi-line)
✅ 2. Variables and Data Types
name = "Raj"
age = 25
height = 5.7
is_student = True
✅ 3. Operators
-
Arithmetic: +
, -
, *
, /
, //
, %
, **
-
Comparison: ==
, !=
, >
, <
, >=
, <=
-
Logical: and
, or
, not
-
Assignment: =
, +=
, -=
, etc.
✅ 4. Control Flow
if age > 18:
print("Adult")
for i in range(5):
print(i)
✅ 5. Data Structures
-
Lists: ordered, changeable
fruits = ["apple", "banana", "cherry"]
-
Tuples: ordered, unchangeable
point = (4, 5)
-
Dictionaries: key-value pairs
student = {"name": "Raj", "age": 20}
-
Sets: unordered, no duplicates
numbers = {1, 2, 3}
✅ 6. Functions
def greet(name):
return "Hello " + name
✅ 7. Input and Output
name = input("Enter your name: ")
print("Hello", name)
✅ 8. Type Casting
age = int("25")
height = float("5.9")
✅ 9. Error Handling (Try/Except)
try:
x = 10 / 0
except ZeroDivisionError:
print("Cannot divide by zero")
✅ 10. Basic File Handling
with open("file.txt", "r") as f:
content = f.read()