Python Programming for Beginners
Step-by-Step Tutorial with Examples, Coding Problems, and
Project Ideas
Prepared by:
Satyajit Mukherjee
M-9433123487
Satyajit Mukherjee | M-9433123487
Step-by-Step Python Tutorial
What is Python?
Python is a high-level, interpreted programming language that's easy to learn and use.
1. Hello World
print("Hello, World!")
2. Variables and Data Types
name = "Satyajit"
age = 25
height = 5.9
is_student = True
3. Conditions (if-else)
age = 18
if age >= 18:
print("Adult")
else:
print("Minor")
4. Loops
for i in range(5):
print(i)
i = 0
while i < 5:
print(i)
i += 1
5. Functions
def greet(name):
print("Hello", name)
greet("Satyajit")
20 Beginner-Level Python Coding Problems with Solutions
Even or Odd
num = int(input("Enter a number: "))
if num % 2 == 0:
print("Even")
else:
print("Odd")
Satyajit Mukherjee | M-9433123487
Check Prime
num = int(input("Enter number: "))
if num > 1:
for i in range(2, num):
if num % i == 0:
print("Not Prime")
break
else:
print("Prime")
else:
print("Not Prime")
Factorial
def factorial(n):
result = 1
for i in range(1, n+1):
result *= i
return result
print(factorial(5))
Sum of Digits
num = 1234
print(sum(int(d) for d in str(num)))
Fibonacci
a, b = 0, 1
for _ in range(10):
print(a, end=" ")
a, b = b, a + b
Mini Python Project Ideas
1. Calculator App – simple math operations using input and if-else.
2. Number Guessing Game – guess the random number with hints.
3. To-Do List – Add, view, and delete tasks.
4. Quiz Game – Multiple choice quiz with score tracking.
5. Password Generator – Generate strong passwords using random module.
Satyajit Mukherjee | M-9433123487