import json

weather_city = {
    "city": "Krakow",
    "temperature": 19,
    "humidity": 30,
    "weather": "Cloudy",
    "wind_speed": 17,
    "description": "Partly cloudy with light rain."
}

with open("pogoda.json", "r") as file:
    data = json.load(file)

city = input("Podaj Nazwe miasta: ")

city_weather = None
for item in data["city_weather"]:
    if item["city"] == city:
        city_weather = item
        break

# wyswietlanie wyników 
if city_weather:
    print(f"\nPogoda: {city_weather["city"]}:")
    print(f"Temperatura: {city_weather["temperature"]}C")
    print(f"Wilgotnosc: {city_weather["humidity"]}%")
    print(f"Stan pogody: {city_weather["weather"]}")
    print(f"Prędkość wiatru: {city_weather["wind_speed"]} km/h")
    print(f"Opis: {city_weather["description"]}")
else:
    print("nie znaleziono informacji o pogodzie w tym miescie! ")





