import requests

url = "https://random-math-problem.p.rapidapi.com/random-problem"

querystring = {"type":"html"}

headers = {
	"X-RapidAPI-Key": "8677538c65mshfd1d85d7adf047fp17a8a1jsn7a54a04df28c",
	"X-RapidAPI-Host": "random-math-problem.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers, params=querystring)

title = response.json().get('title')
problem = response.json().get('problem')

print("Printing response.text")
print(response.text)
Printing response.text
{"title":"<h2>Inverse Digit Sum II<\/h2>","problem":"<div class=\"problem_content\" role=\"problem\">\r\n<p>Writing down the numbers which have a digit sum of 10 in ascending order, we get:\n$19, 28, 37, 46,55,64,73,82,91,109, 118,\\dots$<\/p>\n<p>\nLet $f(n,m)$ be the $m^{\\text{th}}$ occurrence of the digit sum $n$. For example, $f(10,1)=19$, $f(10,10)=109$ and $f(10,100)=1423$.<\/p>\n<p>\nLet $\\displaystyle S(k)=\\sum_{n=1}^k f(n^3,n^4)$. For example $S(3)=7128$ and $S(10)\\equiv 32287064 \\mod 1\\,000\\,000\\,007$.<\/p>\n<p>\nFind $S(10\\,000)$ modulo $1\\,000\\,000\\,007$.<\/p>\n<\/div>"}
print("Printing response.json()")
print(response.json())
Printing response.json()
{'title': '<h2>Inverse Digit Sum II</h2>', 'problem': '<div class="problem_content" role="problem">\r\n<p>Writing down the numbers which have a digit sum of 10 in ascending order, we get:\n$19, 28, 37, 46,55,64,73,82,91,109, 118,\\dots$</p>\n<p>\nLet $f(n,m)$ be the $m^{\\text{th}}$ occurrence of the digit sum $n$. For example, $f(10,1)=19$, $f(10,10)=109$ and $f(10,100)=1423$.</p>\n<p>\nLet $\\displaystyle S(k)=\\sum_{n=1}^k f(n^3,n^4)$. For example $S(3)=7128$ and $S(10)\\equiv 32287064 \\mod 1\\,000\\,000\\,007$.</p>\n<p>\nFind $S(10\\,000)$ modulo $1\\,000\\,000\\,007$.</p>\n</div>'}

Organized Question

Each question has a title and a problem. The title is the name of the project, and the problem stores the actual question. Printing each thing will allow the user to see the specific HTML in the

print("Printing a title")
print(title) 
Printing a title
<h2>Inverse Digit Sum II</h2>
print("Printing a problem")
print(problem)
Printing a problem
<div class="problem_content" role="problem">
<p>Writing down the numbers which have a digit sum of 10 in ascending order, we get:
$19, 28, 37, 46,55,64,73,82,91,109, 118,\dots$</p>
<p>
Let $f(n,m)$ be the $m^{\text{th}}$ occurrence of the digit sum $n$. For example, $f(10,1)=19$, $f(10,10)=109$ and $f(10,100)=1423$.</p>
<p>
Let $\displaystyle S(k)=\sum_{n=1}^k f(n^3,n^4)$. For example $S(3)=7128$ and $S(10)\equiv 32287064 \mod 1\,000\,000\,007$.</p>
<p>
Find $S(10\,000)$ modulo $1\,000\,000\,007$.</p>
</div>