Here is an example Python function that uses the OpenWeatherMap API to get the average temperature of a given city in celsius:

```python
import requests

def get_avg_temp(city):
    # Make a request to OpenWeatherMap API
    response = requests.get(f"http://api.openweathermap.org/data/2.5/weather?q={city}&appid=<your_api_key>")
    
    # Extract the temperature in celsius from the JSON response
    if response.status_code == 200:
        data = response.json()
        temp_celsius = round(data["main"]["temp"] - 273.15, 2)
        return temp_celsius
    else:
        return None
```

To use this function for Tokyo, you can call it like this:

```python
tokyo_temp = get_avg_temp("Tokyo")
print(f"The average temperature in Tokyo is {tokyo_temp}°C.")
```

Note that you will need to replace `<your_api_key>` with your actual OpenWeatherMap API key.
città: Tokio
Scrivi una funzione per ottenere la temperatura media di una data città in Celsius utilizzando l'API OpenWeatherMap.