OBJECTIVE: Write a program in Python that prints the middle value of a dictionary's values, using test_dict from the test_data.py module. NOTE: test_dict is created & imported from the module test_data.py into main.py Example 1: test_dict = ('a':1, 'b':9,'c':2,'d':5} prints 5 Example 2: test_dict = ('b':9,'d':5) prints 5

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
This section has been set as optional by your instructor.
OBJECTIVE: Write a program in Python that prints the middle value of a dictionary's values, using test_dict from the test_data.py module.
NOTE: test_dict is created & imported from the module test_data.py into main.py
Example 1:
test dict = {'a':1,'b':9,'c':2,'d':5} prints 5
Example 2:
test_dict = {'b':9,'d':5} prints 5
Hint: You may(or may not) find the following function useful: list.sort() which sorts the elements in a list.
Note: the result is automatically stored in the original list, and return value from the function is None
Туре
list = [1, 2,3,2,1]
After calling:
list = [1,1,2,2,3]
list.sort(),
339336.2266020 x3zgy7
LAB
13.11.1: Middlest Value (Structured Types)
АCTIVITY
0/11
File is marked as read only
Current file: test_data.py
1 #This module creates the test_dict to be used in main.py
2 #Reads input values from the user & places them into test_dict
3 dict_size = int(input()) #Stores the desired size of test_dict.
4 test_dict = {}
5 for
in range(dict_size): #Loop/Accumulate all of the input values & place into test_dict
(key, value) = input().split(':')
test dict[key] = value
6.
Transcribed Image Text:This section has been set as optional by your instructor. OBJECTIVE: Write a program in Python that prints the middle value of a dictionary's values, using test_dict from the test_data.py module. NOTE: test_dict is created & imported from the module test_data.py into main.py Example 1: test dict = {'a':1,'b':9,'c':2,'d':5} prints 5 Example 2: test_dict = {'b':9,'d':5} prints 5 Hint: You may(or may not) find the following function useful: list.sort() which sorts the elements in a list. Note: the result is automatically stored in the original list, and return value from the function is None Туре list = [1, 2,3,2,1] After calling: list = [1,1,2,2,3] list.sort(), 339336.2266020 x3zgy7 LAB 13.11.1: Middlest Value (Structured Types) АCTIVITY 0/11 File is marked as read only Current file: test_data.py 1 #This module creates the test_dict to be used in main.py 2 #Reads input values from the user & places them into test_dict 3 dict_size = int(input()) #Stores the desired size of test_dict. 4 test_dict = {} 5 for in range(dict_size): #Loop/Accumulate all of the input values & place into test_dict (key, value) = input().split(':') test dict[key] = value 6.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY