Course Content
Introduction to Programming and Python
Overview of Python History and evolution Python’s features and benefits Set-Up Development Environment Installing Python and IDE (e.g., PyCharm, VS Code) Writing and running your first Python program Hands-On Activity Write a simple Python program to display “Hello, World!”
0/3
Structure Of A Python Program
A comprehensive overview of the structure of a Python program, covering essential concepts efficiently.
0/1
Basic Syntax and Control Statements
Basic Syntax Structure of a Python program Data types, variables, and operators
0/3
Object-Oriented Programming (OOP)
0/3
Python Programming For Beginners
About Lesson

Write a Script to Scrape Data from a Website

  • Objective: Write a Python script that scrapes data from a website using requests and BeautifulSoup.
  • Steps:
    1. Send an HTTP request to the website using requests.
    2. Parse the HTML content using BeautifulSoup.
    3. Extract and print the desired data.

    python

    import requests from bs4 import BeautifulSoup url = "https://example.com" response = requests.get(url) soup = BeautifulSoup(response.text, "html.parser") # Extract and print all headings headings = soup.find_all("h1") for heading in headings: print(heading.text)

Implement a Program to Fetch and Display Data from an API

  • Objective: Write a Python program that fetches data from an API and displays it.
  • Steps:
    1. Send an HTTP request to the API endpoint using requests.
    2. Parse the JSON response.
    3. Display the data in a readable format.

    python

    import requests api_url = "https://api.example.com/data" response = requests.get(api_url) data = response.json() # Display the data for item in data: print(f"Name: {item['name']}, Age: {item['age']}")