Q. How many local and global variables are there in the following Python code?
Code:
var1=5 def fn(): var1=2 var2=var1+5 var1=10 fn()
β
Correct Answer: (D)
2 local, 2 global variables
var1=5 def fn(): var1=2 var2=var1+5 var1=10 fn()
You must be Logged in to update hint/solution