Created
May 13, 2012 20:14
-
-
Save semihozkoroglu/2690003 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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