Topic 02 – Variables and Objects

Variables and Objects in Python

The concept of variables and objects are the same in all programming languages. We will be specifically looking at Python and a comparison of Python with other languages.

Typed and Untyped Variable Declaration

A unique aspect of Python is that variables can be declared without declaring the variable type.

For example we can declare an integer i in Python without declaring  the type of variable

i = 1

Whereas a typed declaration would look like

int i = 1

This does not mean that the variable i does not have a type, it just means that the type is not established until the variable is declared and even then it uses the assignment operation to determine the type.

The following article describes typed and untyped languages and the concept of type declarations – https://www.quora.com/What-is-the-meaning-of-untyped-language

Objects and Programming

Different paradigms (or  architectures) exist in programming. The 2 you will hear about the most are procedural programming and object oriented programming. Don’t let these confuse you. Object oriented programming is simply a logical way to organize all the code you write – and object oriented languages are simply languages used to make writing this style of code easier.

A rich discussion of this is on my favorite – Stack Overflow, be sure to read the comments to see the debate – https://stackoverflow.com/questions/552336/oop-vs-functional-programming-vs-procedural