the interchange

October 13, 2019

i talked about simple swapping and how this was supported in Python.  it was also an opportunity for me to discuss object introspection (through the “?” operator), the type function, variable references by assignment, and the copy method.

Here’s my updated GitHub repository:




toy story

October 11, 2019

“Toy Problems” are puzzles or illustrative devices.  they can be useful in discussing features supported by programming languages. it’s a bit of “mental gymnastics” or what can be oxymoronically  referred to as “recreational math”.

i started with something simple called a palindrome:  a word spelled the same backwards as forwards.  However, i extended it to detect “palindromic” strings instead: that is, it should also check multiple words, phrases, or sentences (that exclude a period or full stop).

Here’s the updated GitHub repository:

i introduced user-defined function with def.  i discussed return values, default parameters, functions as arguments, and recursion.  i left out variable scoping and; pass by value vs. pass by reference as i wasn’t sure what to include. my treatment  was, partly, influenced from what i remember being taught about computing from long ago days of uni (i.e undergrad and postgrad) in the Philippines.

here’s the updated GitHub repository:

(the) for(ever) (king)

October 9, 2019

here’s an introduction to the for loop. in C and C++, i used to prefer the for because of its “power” and “flexibility” but now use the while by default in Python because of the “control”.  Moreover, i also discuss the effect of continue and break in loops.

The updated GitHub repository is as follows:

whistle while you work

October 6, 2019

here’s an introduction to the while loop in Python. “while” doing this, the pass and range statements are also introduced.  so far, this has been the “most challenging” discussion – so if anybody has any suggestions on how to make it “better”, i’m more than open.

here’s the updated GitHub repository:

Even Flow

October 4, 2019

it would be “boring” and quite limiting if Python could only perform statements sequentially.  Fortunately like all programming languages, it  supports flow control and has specific mechanisms that support conditional execution (i.e. if) and iteration (i.e.  while and for). i will first tackle if.

It seemed “logical” (excuse the pun) to also discuss the “basic” operators of this type.

Here’s the updated GitHub repository:

i thought since i was discussing the datetime data type it was an apt time for an “introduction” to objects. Moreover, the blog post title seemed relevant since it was advantageous that i had prior ICT experience; but it was also disadvantageous at the same time since my exposure to other programming languages sometimes resulted in “syntax errors” due to force of habit.

The updated GitHub repository is as follows: