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....


This section has been set as optional by your instructor.<br>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.<br>NOTE: test_dict is created & imported from the module test_data.py into main.py<br>Example 1:<br>test dict = {'a':1,'b':9,'c':2,'d':5} prints 5<br>Example 2:<br>test_dict = {'b':9,'d':5} prints 5<br>Hint: You may(or may not) find the following function useful: list.sort() which sorts the elements in a list.<br>Note: the result is automatically stored in the original list, and return value from the function is None<br>Туре<br>list = [1, 2,3,2,1]<br>After calling:<br>list = [1,1,2,2,3]<br>list.sort(),<br>339336.2266020 x3zgy7<br>LAB<br>13.11.1: Middlest Value (Structured Types)<br>АCTIVITY<br>0/11<br>File is marked as read only<br>Current file: test_data.py<br>1 #This module creates the test_dict to be used in main.py<br>2 #Reads input values from the user & places them into test_dict<br>3 dict_size = int(input()) #Stores the desired size of test_dict.<br>4 test_dict = {}<br>5 for<br>in range(dict_size): #Loop/Accumulate all of the input values & place into test_dict<br>(key, value) = input().split(':')<br>test dict[key] = value<br>6.<br>

Extracted 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.

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here