CSV File
CSV File
This document contains 9 queries and their solutions based on GDP analysis for the
years 2020, 2021, and 2022. The queries include operations such as finding maximum
and minimum GDP, growth rates, averages, and more, implemented manually without
Code:
Answer:
Trillion USD
Code:
Answer:
Trillion USD
Code:
Answer:
Trillion USD
Code:
Trillion USD")
Answer:
5. Find the country with the highest GDP growth rate from 2020 to 2021.
Code:
{max_growth[1]:.2f}%")
Answer:
- 26.06%
6. Find all countries with GDP greater than 5 trillion USD in 2022.
Code:
'.join(countries_above_5_trillion)}")
Answer:
China, Germany
Code:
Answer:
8. Calculate the GDP growth rate for each country from 2021 to 2022.
Code:
print(f"{country}: {growth:.2f}%")
Answer:
USA: 10.87%
China: 8.94%
Japan: -2.08%
Germany:
0.00%
India: 17.14%
9. Find the total GDP of countries with GDP below 5 trillion USD in 2022.
Code:
total_below_5 = sum(float(row[3]) for row in data if float(row[3]) < 5.
print(f"Total GDP of countries with GDP below 5 Trillion USD in 2022:
{total_below_5:.2f} Trillion USD")
Answer:
Total GDP of countries with GDP below 5 Trillion USD in 2022: 8.80
Trillion USD