. , indentaton . ,
def func():
print "hello",
print "world"
print . - ..
As for the classes, they are pretty much similar to what you expect - except that the pointer to the current object becomes explicit as the first argument to the function
class myclass:
def classassign(self, string):
self.mystr=string
def classprint(self):
print self.mystr
obj=myclass()
obj.classassign("class var")
obj.classprint()
prints
class var
Personally, Python is not very similar to any other languages that I know, and that is a lot of fun. if this simple class is similar to what you are familiar with, you go. But I recommend a good Python book, since the “Pythonic” way of doing things is probably very different from what you expect
source
share