Write a program dcountlstn which will take a 2-dimensional


Question :

Write a program, dCount(lst,n), which will take a 2-dimensional list which consists of a number (lst[i][0]) and string (lst[i][1]).

The program will read each element in the list and create a dictionary entry with the number as the key and the string as the value until the number equals n.

When the number (lst[i][0]) equals n, the program PRINTS the dictionary and RETURNS the length of the dictionary. If lst is empty, the dictionary will be empty and the length returned will be 0.

It is possible that the list will not contain n in which case it will process through to the end of the list and print the dictionary and return the length as described.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a program dcountlstn which will take a 2-dimensional
Reference No:- TGS02906188

Expected delivery within 24 Hours