|
6 | 6 | '''
|
7 | 7 | import psycopg2
|
8 | 8 |
|
9 |
| -def main(): |
10 |
| - |
11 |
| - question1 = "1. What are the most popular three articles of all time?\n\ |
12 |
| - Which articles have been accessed the most?\n\ |
13 |
| - Present this information as a sorted list with the most popular article at the top\n" |
14 |
| - ''' |
15 |
| - Example: |
16 |
| - "Princess Shellfish Marries Prince Handsome" — 1201 views |
17 |
| - "Baltimore Ravens Defeat Rhode Island Shoggoths" — 915 views |
18 |
| - "Political Scandal Ends In Political Scandal" — 553 views |
19 |
| - ''' |
20 |
| - |
21 |
| - question2 = "2. Who are the most popular article authors of all time?\n\ |
22 |
| - That is, when you sum up all of the articles each author has written, which authors get the most page views?\n\ |
23 |
| - Present this as a sorted list with the most popular author at the top.\n" |
24 |
| - ''' |
25 |
| - Example: |
26 |
| - Ursula La Multa — 2304 views |
27 |
| - Rudolf von Treppenwitz — 1985 views |
28 |
| - Markoff Chaney — 1723 views |
29 |
| - Anonymous Contributor — 1023 views |
30 |
| - ''' |
| 9 | +def main(): |
| 10 | + question1 = """ 1. What are the most popular three articles of all time? |
| 11 | + Which articles have been accessed the most? |
| 12 | + Present this information as a sorted list with the most popular article at the top""" |
| 13 | + |
| 14 | + question2 = """2. Who are the most popular article authors of all time? |
| 15 | + That is, when you sum up all of the articles each author has written, which authors get the most page views? |
| 16 | + Present this as a sorted list with the most popular author at the top.""" |
31 | 17 |
|
32 |
| - question3 = "3. On which days did more than 1% of requests lead to errors?\n\ |
33 |
| - The log table includes a column status that indicates the HTTP status code that the news site sent to the user's browser.\n" |
34 |
| - ''' |
35 |
| - Example: |
36 |
| - July 29, 2016 — 2.5% errors |
37 |
| - ''' |
| 18 | + question3 = """3. On which days did more than 1% of requests lead to errors? |
| 19 | + The log table includes a column status that indicates the HTTP status code that the news site sent to the user's browser.""" |
| 20 | + |
38 | 21 |
|
39 | 22 |
|
40 | 23 |
|
|
0 commit comments