Python Projects aur Practice - Hinglish Guide

Agar tumhe Python achhi tarah sikhni hai, toh chhote-chhote projects banana aur regular practice karna bahut zaroori hai. Niche kuch aasan project ideas, exercises aur unke code diye gaye hain—practice karo aur python master bano!

text

Beginner Python Projects Ideas

Mini Project Code Examples

1. Number Guessing Game

import random

number = random.randint(1, 100)
attempts = 0

while True:
guess = int(input("Guess a number (1-100): "))
attempts += 1
if guess < number:
print("Too low!")
elif guess > number:
print("Too high!")
else:
print(f"Congratulations! {attempts} attempts me sahi guess kiya!")
break
text

2. Text-Based Tic Tac Toe

def print_board(board):
for row in board:
print("|".join(row))
print("-"*5)

def check_winner(board, player):
for row in board:
if all([spot == player for spot in row]):
return True
for col in range(3):
if all([board[row][col] == player for row in range(3)]):
return True
if all([board[i][i] == player for i in range(3)]):
return True
if all([board[i][2-i] == player for i in range(3)]):
return True
return False

board = [[" " for _ in range(3)] for _ in range(3)]
turn = "X"
for _ in range(9):
print_board(board)
row = int(input(f"Player {turn}, enter row (0-2): "))
col = int(input(f"Player {turn}, enter col (0-2): "))
if board[row][col] == " ":
board[row][col] = turn
if check_winner(board, turn):
print_board(board)
print(f"Player {turn} jeet gaya!")
break
turn = "O" if turn == "X" else "X"
else:
print("Spot already taken, try again.")
else:
print_board(board)
print("Draw ho gaya!")
text

3. Measurement Converter (Fahrenheit to Celsius)

def f_to_c(far):
return (far - 32) * 5/9

fahrenheit = float(input("Fahrenheit me temp do: "))
celsius = f_to_c(fahrenheit)
print(f"{fahrenheit}°F = {celsius:.2f}°C")
text

4. Simple Quiz App

questions = {
"Capital of India?": "New Delhi",
"Largest ocean?": "Pacific",
"Python creator?": "Guido van Rossum"
}
score = 0
for question, answer in questions.items():
user = input(question + " ")
if user.strip().lower() == answer.lower():
score += 1
print("Sahi Jawab!")
else:
print(f"Galat. Sahi answer: {answer}")

print(f"Your score: {score}/{len(questions)}")
text

Practice Ke Category Ideas

Practice ke liye GeeksforGeeks, CodeChef, Hackerrank jaisi sites pe coding questions solve karo—ye sab practical learning ke liye best hain. [11][12][13]

Practice aur Learning Tips

Summary

Python projects aur regular practice se hi real mastery aati hai. Mini-projects se strong base banao, rozana code likho, aur kuch time baad tum bade-bade problems bhi confidently solve kar paoge. Coding ka mazaa real practice me hi hai!