Can you show me how to query the Wikipedia API in python?
This function uses the Python requests module which you may need to install separately. 

import requests

def query_wikipedia_api(query):
    url = f"https://en.wikipedia.org/w/api.php?action=query&format=json&prop=extracts&titles={query}&redirects=1"
    response = requests.get(url)
    print(response.json())

query_wikipedia_api("Python programming language")

It takes a search query as input, adds it to the URL for the Wikipedia API query, sends a GET request to the API, and prints the JSON response to the console.