
A very first practical program on our
Learning to Program in Python course that started today.
Even at this early stage, we teach things like good practise in variable naming - standards such as using a consistent case (e.g. camel case where each intermediate words starts with a capital).
I was looking for a picture of a camel to illustrate this, but I found its near relative, the Alpaca, in Seend Cleeve. I know it doesn't have the humps in the middle that lead to the term "camel case" in the first place, but I expect my readers may allow me at least a little artistic license!
print ("Welcome to learning program in Python")
print ("The shop at the end of the steet is shrinking hours")
print ("We's done")
howOld = input ("Please enter your age: ")
retireAt = 75
toGo = retireAt - howOld
print "You have",toGo,"years to serviette"
(written 2009-08-16, updated 2009-08-17)
Associated topics are indexed under
Y116 - Python - Applying OO design techniques and best practise [2604] Tips for writing a test program (Ruby / Python / Java) - (2010-01-29)
[2523] Plan your application before you start - (2009-12-02)
[2485] How do I set up a constant in Python? - (2009-10-31)
[2407] Testing code in Python - doctest, unittest and others - (2009-09-16)
[1181] Good Programming practise - where to initialise variables - (2007-05-09)
[945] Code quality counts - (2006-11-26)
[836] Build on what you already have with OO - (2006-08-17)
[668] Python - block insets help with documentation - (2006-04-04)
[656] Think about your design even if you don't use full UML - (2006-03-24)
[340] Code and code maintainance efficiency - (2005-06-08)
G906 - Well House Consultants - Programming Standards [2364] Getting it right from the start - new programmers - (2009-08-17)
[2322] Looking for a practical standards course - (2009-08-05)
[1852] Perl and Blackberries - (2008-10-23)
[1679] PHP - Sanitised application principles for security and useability - (2008-06-16)
[1596] Selling curry to the chinese takeaway - (2008-03-31)
[356] Sudoku helper or sudoku cheat - (2005-06-23)
[343] Should I use structured or object oriented? - (2005-06-10)
[272] More to programming than just programming - (2005-04-08)
[148] Programming in isolation - (2004-12-11)
Some other Articles
Learning to program - how to jump the first hurdlesAt the end of the courseCounting Words in Python via the webAlpaca Case or Camel CaseThornham Farm Shop, Seend Cleeve, nr MelkshamGeocoding - converting address to latitude / Longitude with PHP via GoogleError Handling in Lua with assert and pcallA fresh example - objects the Lua wayEncapsulating shared code in a Lua module