Python Annotation Project -- 2

Job ID: 34377799

Budget: ₹1,500 – ₹12,500 INR

So, there's this simple python annotation project which is easy but very time-consuming and can be done by anyone. You must read the whole description before bidding.

You will be given some samples for the testing of your understanding. Rs.5.5 per code.

You have to read the passage and write the code based on the question given on the passage.

There's three kinds of passage:


1. Ranks

Passage: A large share of the UNs expenditure addresses its core mission of peace and security, and this budget is assessed separately from the main organizational budget. The peacekeeping budget for the 2015-16 fiscal year was $8.27 billion, supporting 82,318 troops deployed in 15 missions around the world. UN peace operations are funded by assessments, using a formula derived from the regular funding scale that includes a weighted surcharge for the five permanent Security Council members, who must approve all peacekeeping operations. This surcharge serves to offset discounted peacekeeping assessment rates for less developed countries. In 2017, the top 8 providers of assessed financial contributions to Peacekeeping operations were the United States (28.47%), China (10.25%), Japan (9.68%), Germany (6.39%), France (6.28%), United Kingdom (5.77%), Russian Federation (3.99%) and Italy (3.75%). Question: Which country was the fourth most important provider of assessed financial contributions to Peacekeeping operations?

Code :

d = {'United Stated': 28.47, 'China': 10.25, 'Japan': 9.68, 'Germany': 6.39, 'France': 6.28, 'United Kingdom': 5.77, 'Russian Federation': 3.99, 'Italy': 3.75}

order = sorted(d.values())

rank = order[-4]

for i in d:

if d[i] == rank:

print(i)
break

Explanation : You have given the multiple informations, create a dictionary and find the first, second, third , etc. largest or shortes.


2. Comparison

Passage: In 2014, Aston Martin suffered a pre-tax loss of £72 million, almost triple that of 2013 selling 3,500 cars during the year, well below 7,300 sold in 2007 and 4,200 sold in 2013. In March 2014, Aston Martin issued "payment in kind" notes of US$165 million, at 10.25% interest, in addition to the £304 million of senior secured notes at 9.25% issued in 2011. Aston Martin also had to secure an additional investment of £200 million from its shareholders to fund development of new models. It is reported that Aston Martins pre-tax losses for 2016 increased by 27% to £162.8 million, the sixth year it continued to suffer a loss. Question: Which years did Aston Martin not sell more than 5000 cars in?


code: d = {'2007': 7300, '2013': 4200, '2014': 3500}

least = 5000

l = []

for i in d:

if d[i] < least:

l.append(i)

print(l)

Explanation : Get all the data in the dictionary and find the list of the values which satisfies the given condition in the question of the passage.


3. Options

Passage: The Pistons entered the All-Star break at 27–27. The Pistons did surpass their win totals from the 2009–10 NBA season to the 2014–15 NBA season on March 9, 2016, when Detroit defeated the Dallas Mavericks 102–96. On April 6, 2016, following a 108–104 win over the Orlando Magic, the Pistons reached 42 wins and were assured their first winning season since the 2007–08 NBA season. On April 8, 2016, the Pistons defeated the Washington Wizards 112–99 and clinched a playoff berth for the first time since 2009. The eighth-seeded Pistons faced the top-seeded Cleveland Cavaliers in the first round of the 2016 NBA Playoffs. They were swept in four games in a highly-competitive series. Question: Who did the Pistons play first, the Wizards or the Cavaliers?

code:

wizard = 2009
cava = 2016

if wizard < cava:
print('Wizards')

else:
print('Cavaliers')

explanation : These are the types of samples with 'or' in the question where you have to compare it both with if else condition. Create a program like this with 2 variables and print the one which is smaller or greater than the other one as asked in the question.