Given a dictionary of students name with their assigned values: students = {student_1 : 13, student_2...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Given a dictionary of students name with their assigned values: students = {"student_1" : 13, "student_2" : 17, "student_3" :9, "student_4":15, "student_5":8, "student_6": 14, "student_7": 16, "student_8": 12, "student_9": 13, "student_10": 15, "student_11":14, "student_112":9, "student 13": 10, "student 14" : 12, "student_15":13, "student_16":7, "student 17" : 12, "student_18":15, "student_19":9, "student_20":17) Write a python program to partition this dictionary into three sub-dictionaries (group1, group2, group3) based on the assigned values: group1 > 15 group2 <= 15 and > 10 group3 <= 10 Results: group1: {'student_2': 17, 'student_7': 16, 'student_20¹: 17} group2 {'student_1': 13, 'student_4': 15, 'student_6': 14, 'student_8': 12, 'student_9': 13, 'student_10': 15, 'student_11': 14, 'student_14": 12, 'student_15': 13, 'student_17': 12, 'student_18': 15} group3 {'student_3': 9, 'student_5': 8, 'student_112': 9, 'student_13': 10, 'student_16': 7, 'student 19': 9} 2.3 (5 points) Write a Python program that asks the user to enter a string and return a dictionary whose keys are the characters in the string entered, and the values are the number of occurrences of the characters in the string. Example if the entered string is s= 'mumbo jumbo', the program returns the dictionary: Results: Enter some strings: mumbo jumbo {'m': 3, 'u': 2, 'b': 2, 'o': 2, ": 1, 'j': 1} 2.4 (10 points) Write a program in Python that asks the user to enter five integers of their choice and return them a dictionary whose keys are the integers entered and whose values are the lists of divisors of the numbers entered. Example if the user enters the numbers: Enter value of integer n: 12 Enter value of integer n: 3 Enter value of integer n : 21 Enter value of integer n: 40 The dictionary is : d = (12: [1, 2, 3, 4, 6, 12], 3: [1, 3], 21: [1, 3, 7, 21], 40: [1, 2, 4, 5, 8, 10, 20, 40]} For this question, write a function (eg divisorsList(n)) that computes the list of divisors of a given integer (as the argument). For example, for 12, the list will be [1, 2, 3, 4, 6, 12]. During your dictionary construction, call this function divisorsList(n), where n is the user entered integer to construct the key 'n' list. Given a dictionary of students name with their assigned values: students = {"student_1" : 13, "student_2" : 17, "student_3" :9, "student_4":15, "student_5":8, "student_6": 14, "student_7": 16, "student_8": 12, "student_9": 13, "student_10": 15, "student_11":14, "student_112":9, "student 13": 10, "student 14" : 12, "student_15":13, "student_16":7, "student 17" : 12, "student_18":15, "student_19":9, "student_20":17) Write a python program to partition this dictionary into three sub-dictionaries (group1, group2, group3) based on the assigned values: group1 > 15 group2 <= 15 and > 10 group3 <= 10 Results: group1: {'student_2': 17, 'student_7': 16, 'student_20¹: 17} group2 {'student_1': 13, 'student_4': 15, 'student_6': 14, 'student_8': 12, 'student_9': 13, 'student_10': 15, 'student_11': 14, 'student_14": 12, 'student_15': 13, 'student_17': 12, 'student_18': 15} group3 {'student_3': 9, 'student_5': 8, 'student_112': 9, 'student_13': 10, 'student_16': 7, 'student 19': 9} 2.3 (5 points) Write a Python program that asks the user to enter a string and return a dictionary whose keys are the characters in the string entered, and the values are the number of occurrences of the characters in the string. Example if the entered string is s= 'mumbo jumbo', the program returns the dictionary: Results: Enter some strings: mumbo jumbo {'m': 3, 'u': 2, 'b': 2, 'o': 2, ": 1, 'j': 1} 2.4 (10 points) Write a program in Python that asks the user to enter five integers of their choice and return them a dictionary whose keys are the integers entered and whose values are the lists of divisors of the numbers entered. Example if the user enters the numbers: Enter value of integer n: 12 Enter value of integer n: 3 Enter value of integer n : 21 Enter value of integer n: 40 The dictionary is : d = (12: [1, 2, 3, 4, 6, 12], 3: [1, 3], 21: [1, 3, 7, 21], 40: [1, 2, 4, 5, 8, 10, 20, 40]} For this question, write a function (eg divisorsList(n)) that computes the list of divisors of a given integer (as the argument). For example, for 12, the list will be [1, 2, 3, 4, 6, 12]. During your dictionary construction, call this function divisorsList(n), where n is the user entered integer to construct the key 'n' list.
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Suppose the Treasury bill rate is 4% and the market risk premium is 7%. a. What are the project costs of capital for new ventures with betas of .75 and 1.75? b. Which of the following capital...
-
A principal of $5000 is deposited in a savings account that earns interest at a rate of r (written as a decimal), compounded continuously. The amount A(r, t) after t years is A(r, t) = 5000e rt . Use...
-
A researcher wanted to find out if there was difference between older movie goers and younger movie goers with respect to their estimates of a successful actors income. The researcher first...
-
Calculate the following ratios for both 2021 and 2020 years: current ratio, quick ratio, debt to equity ratio, debt ratio, gross profit ratio, net profit ratio, return on equity, return on total...
-
Refer to the data for Rainbow Lodge Ltd. in P4-12A. In P4-12A The following is the unadjusted trial balance for Rainbow Lodge Ltd. at its year end, May 31. The company adjusts its accounts monthly....
-
Bradford Machine plc maintains a general ledger account for each class of inventory, debiting such accounts for increases during the period and crediting them for decreases. The transactions below...
-
Bleaker Company declares and pays its annual dividend near the end of its fiscal year. For the current year, Bleaker's dividend payout ratio was 40 percent, its earnings per common share were \(\$...
-
a. Prepare the statement of cash flows, with a total column for the three-year period. (Do not include reconciliation). b. Comment on significant cash flow items in the statement prepared in (a). c....
-
You have a portfolio that is invested 19 percent in Stock A, 32 percent in Stock B, and 49 percent in Stock C. The betas of the stocks are 74, 1.29, and 1.48, respectively. What is the beta of the...
-
Reba Dixon is a fifth-grade school teacher who earned a salary of $38,000 in 2020. She is 45 years old and has been divorced for four years. She receives $1,200 of alimony payments each month from...
-
What type of information do sales and item reports provide beyond basic financial statements? detailed information on specific products or services sold, including quantity and revenue information on...
-
A study in which the assignment to treatment groups is not made by the investigator is called _________________. In Exercises 510, fill in each blank with the appropriate word or phrase.
-
Qualitative variables can be divided into two types: and __________________. In Exercises 510, fill in each blank with the appropriate word or phrase.
-
A sample of convenience is when it is _____________________ reasonable to believe that there is no systematic difference between the sample and the population. (Choices: acceptable, not acceptable)
-
A ___________________ variable is a quantitative variable whose possible values can be listed. In Exercises 510, fill in each blank with the appropriate word or phrase.
-
A poll is conducted of 3500 households close to major national airports, and another 2000 that are not close to an airport, in order to study whether living in a noisier environment results in health...
-
What are the IAS 16 rules regarding the frequency of revaluations and application of the revaluation model?
-
Find a polar equation for the curve represented by the given Cartesian equation. 4y 2 = x
-
Ulysses and Penelope are married and file separate returns for 2012. Penelope itemizes her deductions on her return. Ulysses' adjusted gross income was $17,400, his itemized deductions were $2,250,...
-
Sally and Charles Heck received the following dividends and interest during 2012: Assuming the Hecks file a joint tax return, complete Schedule B of Form 1040 (on page 2-33) for them for the 2012 tax...
-
David and Darlene Jasper have one child, Sam, who is 6 years old. The Jaspers reside at 4639 Honeysuckle Lane, Los Angeles, CA 90248. David's Social Security number is 577-11-3311, Darlene's is...
-
The following balance sheet and income statement data were taken from the financial records of The Dana Point Company: Required 1. Calculate the following ratios for The Dana Point Company for 2015...
-
The Artic Company's income statement and comparative balance sheets at December 31 of 2019 and 2018 are shown below: Cash dividends of \(\$ 40,000\) were declared and paid during 2019. Plant assets...
-
The following selected balance sheet and income statement data were taken from the financial records of The Ventura Company: Required 1. Use the Dupont Model to compute the 2013 through 2016 return...
Study smarter with the SolutionInn App