import requests

def get_weather_data(location):
    api_key = "http://api.openweathermap.org/data/2.5/forecast?id=524901&appid=66e27dd5405adac1b968bb9ac16695a1"
    base_url = f'http://api.openweathermap.org/data/2.5/weather?appid={api_key}&q={location}'

    try:
        response = requests.get(base_url)
        weather_data = response.json()
        return weather_data
    except requests.exceptions.RequestException as e:
        print('An error occurred:', e)
        return None

def display_weather(weather_data):
    if weather_data is None or 'main' not in weather_data:
        print('Unable to fetch weather data.')
        return

    temperature = weather_data['main']['temp']
    humidity = weather_data['main']['humidity']
    wind_speed = weather_data['wind']['speed']

    print(f'Temperature: {temperature} K')
    print(f'Humidity: {humidity}%')
    print(f'Wind Speed: {wind_speed} m/s')

def main():
    location = input('Enter location (city name, zip code): ')
    weather_data = get_weather_data(location)
    display_weather(weather_data)

if __name__ == '__main__':
    main() 