<human>:  Can you show me a Python function for writing Javascript in a webpage.
<bot>: Here is a Python function for writing Javascript for a webpage

import urllib.parse

def write_javascript(html, js):
  """
  Write javascript to html
  """
  html = html.replace("<script>", "<script>{}</script>".format(js))
  return html

# Enter the html
html = "<html><body><script>alert('hello')</script></body></html>"

# Enter the javascript
js = "alert('hello')"

# Calling the function
html = write_javascript(html, js)

# Printing the html
print(html)

#Example Output
# <html><body><script>alert('hello')</script>alert('hello')</script></body></html>

#Remember to inspect code for bugs.