Question 1: Note: This question has 2 steps. Step 1: Write a…

Question 1: Note: This question has 2 steps. Step 1: Write a function that takes two inputs: 1) a string consisting of a single letter (e.g., ‘e’) 2) a long string consisting of some letters (e.g., ‘HELLo WORld’) and counts how many times the single letter (1st input) occurs in the long string (2nd input). The function should ignore capitalization – i.e., uppercase ‘E’ should be counted as ‘e’, etc. The output of the function should be the frequency count of the letter. Step 2: Write a loop that iteratively calls the function you developed in the first step to count how many times each letter in a given list (e.g., ) occurs in the long string consisting of some letters (2nd input of Step 1). Below is a sample output after completing both steps. longString = ‘HELLo WORld’ aList = Output (after defining the function and running the loop):  The letter a occurs 0 times in the long string. The letter e occurs 1 times in the long string. The letter o occurs 2 times in the long string.

Consider the DataFrame given in the previous question (named…

Consider the DataFrame given in the previous question (named df that already resides in memory). What is the output after running the following code? Assume that pandas package has already been imported. df.set_index(‘Team’,inplace=True) val = df.loc==’East’) & (df>27),:].index print(list(val)) df.reset_index(inplace=True)

Assume that there exists a file named  ‘example.txt’ in the…

Assume that there exists a file named  ‘example.txt’ in the local disk and it includes the following line: 1 2 3 Consider the following code: a_list = file_obj = open(‘example.txt’, ‘w’) for val in a_list: print(val, file=file_obj, end=’ ‘) #file_obj.close() # Commented What are the contents of ‘example.txt’ after running this code?

Information for questions 14-18 The world is made of two cou…

Information for questions 14-18 The world is made of two countries, La La Land, and Liverpond. Labor is the only factor of production. La La Land has 100 hours of labor available to be employed, while Liverpond has 200 hours of labor available to be employed. There are two goods, songs and movies. The following table shows the output of each good per hour of labor, in the two countries.   La La Land Liverpond Songs 10 4 Movies 20 5 In order for both countries to gain from trade, they must trade each movie (not song) for anywhere between

Information for questions 14-18 The world is made of two cou…

Information for questions 14-18 The world is made of two countries, La La Land, and Liverpond. Labor is the only factor of production. La La Land has 100 hours of labor available to be employed, while Liverpond has 200 hours of labor available to be employed. There are two goods, songs and movies. The following table shows the output of each good per hour of labor, in the two countries.   La La Land Liverpond Songs 10 4 Movies 20 5 Calculate the opportunity cost of songs (in terms of movies given up per additional song produced) in La La Land. Enter a whole or decimal number, as appropriate. Enter 0 if the answer cannot be obtained with the information given. Only exact answer accepted.

Information for questions 10-13 The world is made of five co…

Information for questions 10-13 The world is made of five countries, A, B, C, D and E. There are no transportation costs among these countries, just (possibly) tariffs. Countries A and B are considering forming a Regional Trade Agreement (RTA). If they do so, then they will have no tariffs against each other’s goods, but will keep their tariffs against countries C, D, and E. The following table lists the costs of production per automobile in the five countries. Also shown are country A’s tariffs imposed on imports of automobiles from other countries, before and after any RTA is formed.   Cost of production (thousands of $/car) A’s tariff (thousands of $/car) before RTA A’s tariff (thousands of $/car) after RTA Country A 22 — — Country B 15 5 0 Country C 10 5 5 Country D 11 4 4 Country E 18 4 4 Before forming an RTA with country B, country A would import automobiles from: