import requests

def get_weather(api_key, location):
    url = f"https://www.accuweather.com/ar/world-weather={location}&appid={api_key}&units=metric"
    response = requests.get(url)
    data = response.json()
    return data

def display_weather(weather_data):
    if weather_data["cod"] == "404":
        print("City not found. Please check the location.")
    else:
        city = weather_data["name"]
        country = weather_data["sys"]["country"]
        description = weather_data["weather"][0]["description"]
        temperature = weather_data["main"]["temp"]
        humidity = weather_data["main"]["humidity"]
        wind_speed = weather_data["wind"]["speed"]

        print(f"Weather in {city}, {country}:")
        print(f"Description: {description}")
        print(f"Temperature: {temperature}°C")
        print(f"Humidity: {humidity}%")
        print(f"Wind Speed: {wind_speed} m/s")

def main():
    api_key = "YOUR_API_KEY"  # Replace "YOUR_API_KEY" with your actual API key
    location = input("Enter city name or zip code: ")
    weather_data = get_weather(api_key, location)
    display_weather(weather_data)

if __name__ == "__main__":
    main()
