Fix Python – TypeError: a bytes-like object is required, not ‘str’ in python and CSV

TypeError: a bytes-like object is required, not ‘str’

Getting the above error while executing below python code to save the HTML table data in CSV file. Don’t know how to get rideup. Pls help me.
import csv
import requests
from bs4 import BeautifulSoup

url=’http://www.mapsofindia.com/districts-india/’
response=requests.get(url)
html=response.co….