Postgresql | Tasks
CS-303 Programming Fundamentals
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:
- Connect to a publicly available Weather API.
- Retrieve current weather information for Dera Ghazi Khan, Pakistan.
- 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
- Display the retrieved information in a clear and well-organised format.
- 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.