LANGUAGE PROGRAMME
LANGUAGE PROGRAMME
Course Duration : 3 Months
Week 1-2: Introduction to Programming
What is Programming?
Overview of computer programming and its uses.
Introduction to different types of programming languages (compiled vs interpreted, low-level vs high-level).
Setting up Development Environment
Installing Python or any language's IDE (PyCharm, VS Code, Jupyter Notebook, etc.).
Running your first program: "Hello, World!"
Basic Syntax
Variables and Data Types: int, float, string, boolean
Example: x = 5, name = "Alice"
Comments: How to write comments in your code.
Example: # This is a comment
Basic Input/Output
Using print() to display output.
Example: print("Hello, World!")
Using input() to take user input.
Example: name = input("Enter your name: ")
Week 3-4: Control Structures
Conditional Statements
if, else, elif
Example:
python
CopyEdit
age = 18
if age >= 18:
print("You are an adult.")
else:
print("You are a minor.")
Loops
for loop and while loop
Example (for loop):
python
CopyEdit
for i in range(5):
print(i)
Example (while loop):
python
CopyEdit
count = 0
while count < 5:
print(count)
count += 1
Break and Continue
Use of break to exit loops early and continue to skip an iteration.
Example:
python
CopyEdit
for i in range(10):
if i == 5:
break
print(i)
Week 5-6: Functions and Modules
Functions
Defining and calling functions.
Parameters and Return values.
Example:
python
CopyEdit
def greet(name):
return f"Hello, {name}!"
print(greet("Alice"))
Built-in Functions
Overview of Python's built-in functions (len(), type(), max(), min(), etc.).
Example:
python
CopyEdit
print(len("Hello"))
Modules and Libraries
Introduction to Python modules (e.g., math, random, time).
Example:
python
CopyEdit
import math
print(math.sqrt(16))
Week 7-8: Data Structures
Lists
Defining and manipulating lists.
Example:
python
CopyEdit
my_list = [1, 2, 3, 4]
my_list.append(5)
print(my_list)
Tuples
Introduction to immutable tuples.
Example:
python
CopyEdit
my_tuple = (1, 2, 3)
print(my_tuple[0])
Dictionaries
Key-value pairs and basic operations.
Example:
python
CopyEdit
my_dict = {"name": "Alice", "age": 25}
print(my_dict["name"])
Sets
Basic set operations: union, intersection, and difference.
Example:
python
CopyEdit
my_set = {1, 2, 3}
my_set.add(4)
print(my_set)
Week 9-10: Object-Oriented Programming (OOP)
Classes and Objects
Introduction to classes and objects.
Example:
python
CopyEdit
class Dog:
def __init__(self, name, age):
self.name = name
self.age = age
def bark(self):
print(f"{self.name} is barking!")
dog1 = Dog("Buddy", 3)
dog1.bark()
Inheritance and Polymorphism
Extending classes and method overriding.
Example:
python
CopyEdit
class Animal:
def speak(self):
print("Animal speaking")
class Dog(Animal):
def speak(self):
print("Woof!")
dog = Dog()
dog.speak()
Encapsulation
Using private attributes and methods (with underscores).
Example:
python
CopyEdit
class Account:
def __init__(self, balance):
self.__balance = balance
def get_balance(self):
return self.__balance
Week 11-12: Final Project & Real-World Application
Project 1: Simple Command-Line Calculator
Build a simple calculator program that can perform basic operations (addition, subtraction, multiplication, division).
Example structure:
python
CopyEdit
def add(x, y):
return x + y
def subtract(x, y):
return x - y
def multiply(x, y):
return x * y
def divide(x, y):
return x / y
Project 2: Basic Web Scraping
Introduction to web scraping using libraries like BeautifulSoup and requests.
Example:
python
CopyEdit
import requests
from bs4 import BeautifulSoup
url = 'http://example.com'
response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')
print(soup.title)
Final Project:
Work on a larger project that combines the concepts learned in the course (e.g., a to-do list application, a simple web scraper, or a game).