or German (from 3 c er "Actors" and "Actres ring dictionary where

Managerial Accounting: The Cornerstone of Business Decision-Making
7th Edition
ISBN:9781337115773
Author:Maryanne M. Mowen, Don R. Hansen, Dan L. Heitger
Publisher:Maryanne M. Mowen, Don R. Hansen, Dan L. Heitger
Chapter3: Cost Behavior And Cost Forecasting
Section: Chapter Questions
Problem 41E: Examine the graphs in Exercise 3-40. Required: As explained in the chapter, cost behavior patterns...
icon
Related questions
Question
Question:
As a programmer, you want to create a function to arrange the names of the
actors and actresses based on their country. You will be given all the
required information in a dictionary called my_dictionary which shall be
passed as argument to the function call. Assume, the actors/actresses are
either American, Korean or German (from 3 countries only). The names are
further categorized under "Actors" and "Actresses".
You are given the following dictionary where you have a nested dictionary
containing a tuple.
my_dictionary = {'American': {'Actors': ('Tom Cruise', 'Leonardo
DiCaprio'), 'Actresses': ('Scarlett Johansson', 'Angelina
Jolie')}, "Korean': {'Actors': ("Lee in-ho', 'Song Joong-ki","Choi
Jin-hyuk')}, 'German': {'Actors': ('David Kross', 'Michael
Fassbender'), 'Actresses':('Diana Kruger')}}
Write a python function that will take this dictionary as an argument in a
function call which will convert this dictionary into the following tuple
and return it.
[Hint: You might need to use 3 nested loops.]
Output tuple(You just have to print the resultant tuple.):
(('Tom Cruise', 11010), ('Leonardo DiCaprio', 11017), ('Scarlett
Johansson', 12018), ('Angelina Jolie', 12014), ('Lee in-ho', 21009), ('Song
Joong-ki', 21013), ('Choi Jin-hyuk', 21013), ('David Kross', 31011),
('Michael Fassbender', 31018), ('Diana Kruger', 32012))
The output tuple consists of tuples as the elements. Each nested tuple has
the name of the actor/actress (string) and an ID (integer) which is to be
generated using the described process below.
1==> First Digit of the ID:
1a--> American is represented with 1
1b--> Korean is represented with 2
1c--> German is represented with 3
2==> Second digit of the ID represents type. Here
2a--> 1 means Actors
2b--> 2 means Actresses
3==>The last 3 digits of the Id is basically the length of the names of the
actors/actresses including any spaces in between the names. For example,
the length of the name "Tom Cruise" is 10 and so the last 3 digits are 010.
For simplicity, you can consider that the length of the names of the
actors/actresses will not be greater than 99.
4==> Do not worry about the uniqueness of these ids in the output. They do
not have to be unique.
Remember: Your code should work for all types of similar dictionaries if
the sample dictionary is changed.
Transcribed Image Text:Question: As a programmer, you want to create a function to arrange the names of the actors and actresses based on their country. You will be given all the required information in a dictionary called my_dictionary which shall be passed as argument to the function call. Assume, the actors/actresses are either American, Korean or German (from 3 countries only). The names are further categorized under "Actors" and "Actresses". You are given the following dictionary where you have a nested dictionary containing a tuple. my_dictionary = {'American': {'Actors': ('Tom Cruise', 'Leonardo DiCaprio'), 'Actresses': ('Scarlett Johansson', 'Angelina Jolie')}, "Korean': {'Actors': ("Lee in-ho', 'Song Joong-ki","Choi Jin-hyuk')}, 'German': {'Actors': ('David Kross', 'Michael Fassbender'), 'Actresses':('Diana Kruger')}} Write a python function that will take this dictionary as an argument in a function call which will convert this dictionary into the following tuple and return it. [Hint: You might need to use 3 nested loops.] Output tuple(You just have to print the resultant tuple.): (('Tom Cruise', 11010), ('Leonardo DiCaprio', 11017), ('Scarlett Johansson', 12018), ('Angelina Jolie', 12014), ('Lee in-ho', 21009), ('Song Joong-ki', 21013), ('Choi Jin-hyuk', 21013), ('David Kross', 31011), ('Michael Fassbender', 31018), ('Diana Kruger', 32012)) The output tuple consists of tuples as the elements. Each nested tuple has the name of the actor/actress (string) and an ID (integer) which is to be generated using the described process below. 1==> First Digit of the ID: 1a--> American is represented with 1 1b--> Korean is represented with 2 1c--> German is represented with 3 2==> Second digit of the ID represents type. Here 2a--> 1 means Actors 2b--> 2 means Actresses 3==>The last 3 digits of the Id is basically the length of the names of the actors/actresses including any spaces in between the names. For example, the length of the name "Tom Cruise" is 10 and so the last 3 digits are 010. For simplicity, you can consider that the length of the names of the actors/actresses will not be greater than 99. 4==> Do not worry about the uniqueness of these ids in the output. They do not have to be unique. Remember: Your code should work for all types of similar dictionaries if the sample dictionary is changed.
9:26 AM O N a
* ll 26
A number of graphs displaying cost behavior
patterns are shown below. The vertical axis on
each graph represents total cost and the
horizontal axis represents the level of activity
(volume).
2
3
FPPE
5
10
11
12
Transcribed Image Text:9:26 AM O N a * ll 26 A number of graphs displaying cost behavior patterns are shown below. The vertical axis on each graph represents total cost and the horizontal axis represents the level of activity (volume). 2 3 FPPE 5 10 11 12
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Similar questions
Recommended textbooks for you
Managerial Accounting: The Cornerstone of Busines…
Managerial Accounting: The Cornerstone of Busines…
Accounting
ISBN:
9781337115773
Author:
Maryanne M. Mowen, Don R. Hansen, Dan L. Heitger
Publisher:
Cengage Learning
Financial & Managerial Accounting
Financial & Managerial Accounting
Accounting
ISBN:
9781285866307
Author:
Carl Warren, James M. Reeve, Jonathan Duchac
Publisher:
Cengage Learning
Accounting (Text Only)
Accounting (Text Only)
Accounting
ISBN:
9781285743615
Author:
Carl Warren, James M. Reeve, Jonathan Duchac
Publisher:
Cengage Learning
Accounting Information Systems
Accounting Information Systems
Finance
ISBN:
9781337552127
Author:
Ulric J. Gelinas, Richard B. Dull, Patrick Wheeler, Mary Callahan Hill
Publisher:
Cengage Learning
Accounting
Accounting
Accounting
ISBN:
9781337272094
Author:
WARREN, Carl S., Reeve, James M., Duchac, Jonathan E.
Publisher:
Cengage Learning,