-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapi.py
More file actions
23 lines (21 loc) · 766 Bytes
/
Copy pathapi.py
File metadata and controls
23 lines (21 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import wolframalpha
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
client = wolframalpha.Client("apikey")
# Instance of wolf ram alpha
country = input('Country: ')
res = client.query('What is the population of ' + country + '?')
answer = next(res.results).text
print(answer)
res = client.query('What is the life expectancy of ' + country + '?')
answer = next(res.results).text
print(answer)
res = client.query('What is the capital of ' + country + '?')
answer = next(res.results).text
print(answer)
res = client.query('What is the GDP of ' + country + '?')
answer = next(res.results).text
print(answer)
res = client.query('What are the three largest cities in ' + country + '?')
answer = next(res.results).text
print(answer)