Tip Calculator

CodeAcademyTipCalculatorLab: Code Academy and Python Syntax

For this lab I went to codeacademy.com to get hands on with some python syntax after reading chapters 1 and 2 of How to Think Like a Computer Scientist. Code academy is a free website with an optional premium subscription that teaches programming in variety of different language. First I began by completing the Python Syntax Tutorial. This incorporates some practice on variables (storage containers for datatypes), Boolean logic (a datatype regarding two states : True or false), while lightly touching on the topic of whitespace (the placement/grammar for structuring python code), and statements(smallest possible element of a language that expresses actions to be run).

I also practiced leaving comments in my code that wouldn’t interfere with it thanks to using # to have the computer disregard line. For multiline comments, three quotation marks at the beginning and end of the statement nullify the characters (“””insert code“””) . Lastly it speaks about math operators. This was actually very simple to do in python. My favorite operation is the modulos operator (%) that finds the remainder of two dividends. It seems as if it could be used for many interesting tricks.

The tutorial was quite easy but despite being so easy, it seems like an exceptional warm up exercise to a programming novice who still might be unsure about the basics without a quick look back at some notes. After the short tutorial, I moved on to the Tip Calculator lesson. Here the programming had a more practical and real life application to an everyday problem. This was done by assigning some values to some variables. Then mixing those variables with some math operators to create a formula. The program was easy and although I do wish it had gone into further detail right away with the last line of code, it does so further on in the Code Academy lessons.