CodeCraft Innovation
*Roadmap to learn HTML & CSS Roadmap in 1 month*
*Week 1: HTML Basics*
What is HTML and how the web works
Basic page structure: , , ,
Headings ( to ), Paragraphs, Links, Images
Lists (, , ), Tables
Forms: , , , buttons
Semantic HTML: , , , , ,
> Mini Project: Create a simple personal profile page using only HTML.
*Week 2: CSS Basics*
What is CSS? Inline vs Internal vs External
CSS Syntax: Selectors, Properties, Values
Colors, Units (px, %, em, rem), Fonts
Box Model (margin, border, padding, content)
display: block, inline, inline-block
position: static, relative, absolute, fixed
> Mini Project: Style your HTML profile page with colors, fonts, and spacing.
*Week 3: Layout with CSS*
Flexbox (justify-content, align-items, flex-wrap)
Grid (grid-template-columns, grid-gap, etc.)
Float & Clear (basic understanding)
z-index, overflow
> Mini Project: Build a responsive 3-column layout using Flexbox or Grid.
*Week 4: Responsive Design*
Media Queries
Mobile-first design
Units: vh, vw, em, rem for responsiveness
Using responsive images and typography
> Mini Project: Build a responsive landing page (like a product page or blog homepage)
React with ❤️ if you want similar roadmap for Javascript
*ENJOY LEARNING* 👍👍
Now, let's move to the next important topic in the Python Learning Series:
*Decorators*
A decorator is a function that adds extra functionality to another function without modifying its actual code.
Think of it like wrapping a gift — the gift (function) stays the same, but you add some nice packaging (extra features).
*How Does It Work?*
In Python, functions are first-class objects — they can be passed around just like variables. This makes decorators possible.
*Syntax Example:*
def greet(func):
def wrapper():
print("Hello!")
func()
print("Have a nice day!")
return wrapper
def say_name():
print("I am learning Python.")
say_name()
*Output:*
Hello!
I am learning Python.
Have a nice day!
Here, is the decorator that wraps say_name().
*Without Using @ Symbol:*
def greet(func):
def wrapper():
print("Hello!")
func()
print("Have a nice day!")
return wrapper
def say_name():
print("I am learning Python.")
say_name = greet(say_name)
say_name()
Works the same way!
*Where Are Decorators Used?*
- Logging
- Access control
- Timing functions
- Modifying behavior for frameworks (like Flask, Django)
*React with ❤️ once you're ready for the next quiz on decorators*
Now, let's move to the next topic in the Python Learning Series.
*Classes and Objects*
*What is a Class?*
A class is a blueprint — just like an architect’s plan for building houses.
In Python, you create a class using the class keyword.
class Dog:
# This is a class
pass
This doesn't do much yet — it's just an empty plan.
*What is an Object?*
An object is something created from the class — like an actual house built from the plan.
my_dog = Dog()
Now, my_dog is an object (or instance) of the Dog class.
*Let’s Build a Useful Example*
*1. Define the Class*
class Dog:
def __init__(self, name, breed):
self.name = name # Attribute
self.breed = breed # Attribute
def bark(self):
print(f"{self.name} says: Woof!")
__init__() is a special method that runs automatically when you create an object.
self refers to the object being created.
name and breed are attributes.
*2. Create Objects*
dog1 = Dog("Bruno", "Labrador")
dog2 = Dog("Tommy", "Pug")
Now you’ve created two objects of the Dog class.
*3. Call Methods on Objects*
dog1.bark() # Output: Bruno says: Woof!
dog2.bark() # Output: Tommy says: Woof!
*Another Simple Example: Student Class*
class Student:
def __init__(self, name, grade):
self.name = name
self.grade = grade
def display_info(self):
print(f"Name: {self.name}, Grade: {self.grade}")
s1 = Student("Alice", "A")
s2 = Student("Bob", "B")
s1.display_info() # Output: Name: Alice, Grade: A
s2.display_info() # Output: Name: Bob, Grade: B
*Quick Recap:*
- Class: A blueprint or design for creating objects.
- Object: An instance created from the class.
- __init__: A special method (called constructor) that runs automatically when an object is created.
- self: Refers to the current object itself.
- Method: A function defined inside a class that performs an action on the object.
- Attribute: A variable that belongs to the object, usually defined inside __init__.
Now, let’s move to the next topic in the Python Learning Series
*Working with Dates & Time* 📅⏰
*1. Importing the datetime module*
To work with dates and times, Python provides a built-in module called datetime.
import datetime
*2. Getting the current date and time*
from datetime import datetime
now = datetime.now()
print(now) # Shows full date and time
print(now.date()) # Only date part
print(now.time()) # Only time part
*3. Creating a specific date or time*
from datetime import datetime
my_birthday = datetime(1995, 8, 25) # Year, Month, Day
print(my_birthday)
You can also add hours, minutes, and seconds:
specific_time = datetime(2023, 10, 5, 15, 30, 45)
*4. Formatting Dates (strptime & strftime)*
strftime() — Convert datetime to string in a desired format.
now = datetime.now()
print(now.strftime("%Y-%m-%d")) # Output: 2025-05-01
print(now.strftime("%d/%m/%Y")) # Output: 01/05/2025
strptime() — Convert string back to a datetime object.
date_str = "01/05/2025"
date_obj = datetime.strptime(date_str, "%d/%m/%Y")
print(date_obj)
*5. Doing math with dates (timedelta)*
Use timedelta to add or subtract days, hours, etc.
from datetime import timedelta
today = datetime.now()
tomorrow = today + timedelta(days=1)
yesterday = today - timedelta(days=1)
print("Tomorrow:", tomorrow)
print("Yesterday:", yesterday)
You can also calculate the difference between two dates:
d1 = datetime(2025, 5, 10)
d2 = datetime(2025, 5, 1)
difference = d1 - d2
print(difference.days) # Output: 9
*How to calculate someone’s age*
dob = datetime(1998, 4, 15)
today = datetime.now()
age = today.year - dob.year
# Adjust if birthday hasn’t occurred yet this year
if (today.month, today.day) < (dob.month, dob.day):
age -= 1
print("Age:", age)
*Useful formatting codes for dates*
%Y – Full year (2025)
%y – Short year (25)
%m – Month (01-12)
%d – Day (01-31)
%H – Hour (00-23)
%M – Minute (00-59)
%S – Second (00-59)
This topic is super useful in automation, data analysis, and even web scraping.
Click here to claim your Sponsored Listing.
Category
Telephone
Website
Address
Blantyre