Question: Copy the main( ) program below (including the required #include lines) into yourfile and IMMEDIATELY save your file.Place your code for the required functions below
Copy the main( ) program below (including the required #include lines) into yourfile and IMMEDIATELY save your file.Place your code for the required functions below the main in yourfile and IMMEDIATELY save your file.Test your solution thorougly after completing your code and correctyour solution as required.Provide a complete solution to the following problem using the Pythonprogramming language.READ THE ENTIRE QUESTION (AND THE EXAMPLE) CAREFULLY BEFORE DEVELOPINGYOUR SOLUTION!PART A:Write the code for a python function called loadData that acceptsa dictionary, a key (string), and 2 whole numbers n and m. This function uses alist comprehension to create a 2-Dimensional list (array) of n rows bym columns and fills every element of this list with the character '-'. Thefunction then stores the 2D list in the dictionary using the supplied stringas the key. This function returns the entire dictionary (8 marks).PART B:Write the code for a python function called updateData that accepts aloaded dictionary from PART A, a key (string), 2 whole numbers n and m,and a string that holds the name of a file on disk.This function reads the character at line n and column m from the fileand inserts it into the 2D list in the dictionary using the supplied key.The file must be closed after a successful read.You may assume that there will always be a valid character in the fileat row n and column n and that n and m are also valid positions in the2D list in the dictionary (12 marks).'''sample file 10x10 named "langs.txt"^^^^X^^^^^^2^^^^^^8^^PHP^^^^^^^PYTHON^^^^^^^^C++^^^^JSCRIPT^PHP^^WEB^^GO-LANG^^^^^^RUBY^^^^^^^^RUST^'''import mathimport randomimport stringimport collectionsimport datetimeimport reimport timeimport copy# program: studentID_PRG550X.221.LT1.py# student: danny abesdris# student number: 123456789# date: february 25, 2022# purpose: solution to PRG550X Lab Test #1# Your functions MUST be placed here...def main( ) : table1 = { } table2 = loadData(table1, "mask", 10, 10) yCoords = [ 3,4,5,6,7,8,9,10 ] xCoords = [ 4,3,7,6,1,2,5,9 ] for i in range(len(yCoords)) : updateData(table2, "mask", yCoords[i], xCoords[i], "langs.txt")if __name__ == "__main__" : main( )# printing every row and column (10x10) of the 2D-list stored using key "mask"# in the dictionary "table2" in the main above, would display:-----------------------P--------Y-------------+--------R----P----------O------------R-------------T-RESOURCES: Computer/Compiler permitted and access to ALL online material.Once completed, e-mail your solution as a plain text SINGLE file with a .txtfile extension, properly indented and formatted with meaningful variable names(using camelCase notation) to:
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
