Question:
class Vehicle: #Line 1
Type = 'Car' #Line 2
def __init__(self, name): #Line 3
self.Name = name #Line 4
def Show(self): #Line 5
print self.Name,Vehicle.Type #Line 6
V1=Vehicle("BMW") #Line 7
V1.Show() #Line 8
Vehicle.Type="Bus" #Line 9
V2=Vehicle("VOLVO") #Line 10
V2.Show() #Line 11
(i) What is the difference between the variable in Line 2 and Line 4 in the above Python code?
(ii) Write the output of the above Python code.
C. Sir| Created: 9-Jan-2019 | Updated: 9-Jan-2019|CBSE12A-2018
