Learn with Yasir

Share Your Feedback

Postgresql | Tasks


CS-303 Programming Fundamentals

Topic 1: Retrieve Current Weather Information Using a Weather API

Task: Write a Python program that uses a Weather API to retrieve and display the current weather information for Dera Ghazi Khan, Pakistan.

Task Requirements

Your program should:

  1. Connect to a publicly available Weather API.
  2. Retrieve current weather information for Dera Ghazi Khan, Pakistan.
  3. Display the following information:
    • City Name
    • Current Temperature (°C)
    • Weather Condition (e.g., Sunny, Cloudy, Rainy)
    • Humidity (%)
    • Wind Speed
    • Date and Time of Weather Information
  4. Display the retrieved information in a clear and well-organised format.
  5. Handle API connection errors or invalid responses appropriately.

Submission and Checking

  • Due Date: Monday, 30 November 2026.
  • Submission: Submit your Python source code (.py file).
  • Demonstration: Run your program in class and explain how it retrieves and displays weather information.
  • Evaluation: Correct API integration, accurate data retrieval, program output, and error handling.