import requests

def get_weather_data(city_name, api_key):
    base_url = "http://api.openweathermap.org/data/2.5/weather?"
    complete_url = f"{base_url}appid={api_key}&q={city_name}&units=metric"
    response = requests.get(complete_url)
    return response.json()

def display_weather(data):
    if data["cod"] != "404":
        main_data = data["main"]
        temperature = main_data["temp"]
        pressure = main_data["pressure"]
        humidity = main_data["humidity"]
        weather = data["weather"]
        weather_description = weather[0]["description"]
        print(f"Weather in {city_name}:")
        print(f"Temperature: {temperature}°C")
        print(f"Pressure: {pressure} hPa")
        print(f"Humidity: {humidity}%")
        print(f"Description: {weather_description}")
    else:
        print("City not found.")

if __name__ == "__main__":
    api_key = "YOUR_API_KEY"
    city_name = input("Enter city name: ")
    weather_data = get_weather_data(city_name, api_key)
    display_weather(weather_data)
