Question: ( b ) Observe the following Python code carefully and obtain the output, which will appear on the screen after execution of it . i

(b) Observe the following Python code carefully and obtain the output, which will appear on the screen after execution of it.
i,j,k,n=5,6,7,3
print (i+j**k-k%n)
print (i??n)
(c) Give the difference between the type casting and automatic type conversion. Also, give a suitable Python code to illustrate both.
(d) What do you understand by local and global scope of variables? How can you access a global variable inside the function, if function has a variable with same name?
(e) What will be the output of the following Python code?
(i) class A :
def init (self,x):
self. x=x
def count(self,x):
self. x= self x+1
class B(A) :
def (self,y=0):
A.(self,3)
self. y=y
def count(self):
self. y+=1
def main():
obj = Bo
obj count()
print(obj.x, obj.y)
maino
(2)
 (b) Observe the following Python code carefully and obtain the output,

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!