Differences between revisions 1 and 12 (spanning 11 versions)
Revision 1 as of 2009-11-08 13:27:27
Size: 533
Editor: pool-173-57-63-56
Comment:
Revision 12 as of 2013-08-09 04:14:36
Size: 341
Editor: Lawerence
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Here are some samples to help get a better idea of Python's syntax:

String formatting

{{{
name = 'Monty'
print 'Hello, %s' % name
}}}

Defining a function

{{{
def add_one(x):
    return x + 1
}}}

Defining a class with two methods

{{{
class Talker(object):
    def greet(self, name):
        print 'Hello, %s!' % name
    def farewell(self, name):
        print 'Farewell, %s!' % name
}}}

Defining a list

{{{
dynamic_languages = ['Python', 'Ruby', 'Groovy']
dynamic_languages.append('Lisp')
}}}
49 yr old Grain, Oilseed or Field Gardener (Australia) / Field Crop Gardener (New Zealand ) Kilcullen from Corner Brook, has lots of interests including beatboxing, free microsoft codes and tesla coils. that contained visiting Srebarna Nature Reserve.<<BR>>
<<BR>>
My weblog :: [[http://www.freemicrosoftpointscodes.org/|free ms codes]]

49 yr old Grain, Oilseed or Field Gardener (Australia) / Field Crop Gardener (New Zealand ) Kilcullen from Corner Brook, has lots of interests including beatboxing, free microsoft codes and tesla coils. that contained visiting Srebarna Nature Reserve.

My weblog :: free ms codes

BeginnersGuide/Programmers/SimpleExamples (last edited 2020-03-20 17:37:52 by MarcAndreLemburg)

Unable to edit the page? See the FrontPage for instructions.