Question: 2. Consider the following Python program: 010 020 030 040 050 060 070 080 090 100 110 120 130 140 150 160 170 180 190

 2. Consider the following Python program: 010 020 030 040 050

2. Consider the following Python program: 010 020 030 040 050 060 070 080 090 100 110 120 130 140 150 160 170 180 190 200 x= 1; y= 3; z= 5; def sub10: a = 7; y = 9; z=11; # BODY OF SUB1 def sub20: global x; a = 13; x = 15; w = 17; # BODY OF SUB2 def sub30): nonlocal a; a=19; b=21; z= 23; # BODY OF SUB3 a) List all variables visible at BODY OF SUBI (line 080) along with the line numbers where they are declared, assuming static scoping is used. b) List all variables visible at BODY OF SUB2 (line 140) along with the line numbers where they are declared, assuming static scoping is used. c) List all variables visible at BODY OF SUB3 (line 200) along with the line numbers where they are declared, assuming static scoping is used

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!