user
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.

### Instruction:
Write a function to get the average temperature of a given city in celsius using OpenWeatherMap API.

### Input:
city: Tokyo

### Response:
assistant
"""
Write a function to get the average temperature of a given city in celsius using OpenWeatherMap API.
"""

import requests
import json 

def get_average_temp(city):
    key = 'Your OpenWeatherMap API key'
    url = 'http://api.openweathermap.org/data/2.5/weather?q={}&appid={}'.format(city, key)
    response = requests.get(url)
    data = json.loads(response.text)
    temperature = data['main']['temp']
    celsius = temperature - 273.15
    return celsius
    
if __name__ == '__main__':
    print(get_average_temp('Tokyo'))