# -*- coding: utf-8 -*-
"""Khalid AlHarbi-Simple Weather App (No GUI)

Automatically generated by Colaboratory.

Original file is located at
    https://colab.research.google.com/drive/1z8AOlLGmhIMSlG-5kZQvNXLhqFF-YDhM
"""

import requests

def get_weather(city_name):
    api_key = 'YOUR_API_KEY'  # Replace 'YOUR_API_KEY' with your actual API key
    url = f'http://api.openweathermap.org/data/2.5/weather?q={city_name}&appid={api_key}&units=metric'
    response = requests.get(url)
    if response.status_code == 200:
        data = response.json()
        weather_description = data['weather'][0]['description']
        temperature = data['main']['temp']
        humidity = data['main']['humidity']
        wind_speed = data['wind']['speed']
        print(f"Weather in {city_name}:")
        print(f"Description: {weather_description}")
        print(f"Temperature: {temperature}°C")
        print(f"Humidity: {humidity}%")
        print(f"Wind Speed: {wind_speed} m/s")
    else:
        print("Error fetching weather data. Please check your input and try again.")

def main():
    city_name = input("Enter the name of the city: ")
    get_weather(city_name)

if __name__ == "__main__":
    main()