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:

https://github.com/LinsAbadia/Python/tree/master/Problems/Exercises

 

 

Advertisements

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:

https://github.com/LinsAbadia/Python/tree/master/Problems/Toy

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:

https://github.com/LinsAbadia/Python/tree/master/FlowControl

(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:

https://github.com/LinsAbadia/Python/tree/master/FlowControl

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:

https://github.com/LinsAbadia/Python/tree/master/FlowControl

barely breathimg

October 5, 2019

i’m currently taking natural supplements daily to help combat my hay-fever (rhinitis to be technical),  It helps a little but I can feel when the pollen count is high (even when the entire house is closed) or even when it’s only moderate if a window’s left open.  It can manifest itself through itchy eyes, constant sneezing, blocked nostrils, or in really sever cases, an inability to breathe.

i noticed today that i exhibited the first two symptoms – which i noticeably have less of.  However, my wife propped a window open as she was cooking – even once i closed it i knew i was too late and the pollen had already gotten in the house because i couldn’t stop rubbing my eyes.  Later, i had a string of sneezes – which i now rarely do.

it was only once we lived in Adelaide that it became obvious – i lived in Melbourne for a year and was unaware of it then – some say it’s because the wind here blows through deserts.  even when i was in the Philippines and Victoria i sneezed consecutively ( my record is 27. if i recall correctly) so i must have had some form of allergy.

you need to understand that for someone with claustrophobia the prospect of not being able to breathe is a really terrifying proposition.  Moreover, sneezing “wildly” for anyone using a rollator, forget steering but trying to maintain upright balance.

it’s  more prominent now since it’s Spring.  It’s “harder” to do my daily speech exercises now as my nose is blocked. it can be quite challenging to produce the correct sounds while also multiplexing breathing with the mouth – co-ordination is not a strength these days!

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:

https://github.com/LinsAbadia/Python/tree/master/FlowControl