Skip to content

Instantly share code, notes, and snippets.

@semihozkoroglu
Created May 13, 2012 20:14
Show Gist options
  • Save semihozkoroglu/2690003 to your computer and use it in GitHub Desktop.
Save semihozkoroglu/2690003 to your computer and use it in GitHub Desktop.
class Myclass:
def __init__(self,x):
self.ozellik = x
def foomethodu(self,x,y):
self.x = x
self.y = y
nesne1 = Myclass(2)
nesne1.foomethodu(1,8)
nesne2 = Myclass(3)
nesne2.foomethodu(2,9)
print "nesne1 x : ", nesne1.x
print "nesne1 y : ", nesne1.y
print "nesne1 ozellik : ", nesne1.ozellik
print "nesne2 x : ", nesne2.x
print "nesne2 y : ", nesne2.y
print "nesne2 ozellik : ", nesne2.ozellik
def bar():
print nesne1.x + nesne2.x
bar()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment