This is a simple REST API containing "Hello world" print statements in 20 different computer languages.
Go to API Go to GitHub repo
{
"Python": [
{
"ln": 1,
"Code":"print(\"Hello World!\")"
}
],
"Java": [
{
"ln": 2,
"Code":"public class Main {\n public static void main(String[] args) {\n\tSystem.out.println(\"Hello World!\");\n }\n}"
}
],
}
#!/usr/bin/python3
import requests
req = requests.get("https://theducky.github.io/HelloWorld-API/APIs/HelloWorld.json")
dct = req.json()
pst = dct["Python"]
pst2 = dct["Java"][0]["Code"]
print(pst)
print(pst2)
[{'Code': 'print("Hello World!")'}]
public class Main {
public stativ void main(String[] args) {
System.out.println("Hello World!");
}
}