Jeff H.

asked • 12/13/19

write a program that parses the testProgram string and any other programs that has functions calling each other. The program needs to print out

write a program that parses the testProgram string and any other programs that has functions calling each other. The program needs to print out:

 

  1. A Python Dictionary with key:value pairs where the key is the name of a function, and the value is a list of the functions being called by that function. So, for testProgram, the dictionary would look like: { “myF”: [ ‘funF1’. ‘funF2’, ‘funF3’ ]. “funF1”: [], “funF2”: [ ‘funF3’, ‘funF2’], ‘funF3’: [‘funF2’, ‘funF1’’] }
  2. A list of tuples with the name and the number of statements in each program. For this test, the statements are terminated by ‘;’, a program begins with ‘{‘ and end with ‘}’

So, testProgram would have [(‘myF’, 7), (‘funF1’, 1), (‘funF2’, 3), (‘funF3’, 1)]

 

Brian Z.

Can you give more details about your problem, and all testProgram string?
Report

12/16/19

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.