Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Variables.py
#python 3.5.2 #instance and static variables class Car: wheel=4#static varible,create ouside to all methods and inside the class def __init__(self,name,mil): self.name=name#instance variables defined inside __init__() #In this example name and mil self.mil=mil def car_details(self): print("Car details:\n",'Name ',self.name,'\n','Milege ',self.mil,'\n','Wheels ',Car.wheel) c1=Car('Audi','5kmph') c2=Car('BMW','6kmph') #c1.name='Volvo'#instance variables can be accessed outside __init__() method i.e those are not local to __init__() c1.car_details() c2.car_details() #note-instance variables must be called on object #but static variables can be called either by class name or object
run
|
edit
|
history
|
help
0
metods.py
shuru5
DICTIONARY PROBLEM
print
linked_lists
filtering python3
chickens,cows,pigs values defined
Multiply two marrix
Partition To 2 Equal Sum Subsets From An Array of Integers
hw5 ss while