Welcome to Unit 1 of the essentials of Python for use in data analysis.
This unit will cover the basic syntax, data types, operators and statements that will become the fundamental building blocks in your Python journey.
Printing "Hello, World!" has become a "rite of passage" for someone starting to learn programming. The program below uses the print( ) function to show you the output which is a string(text) that says "Hello, World!". Keep this function in mind as we will need to use it in Units 1.2 and 1.3 before we talk about it in Unit 1.4.
Run your first Python program by clicking the Run button!
Programming is the process of creating a set of instructions that tell a computer how to perform a task. It allows us to design how we want a computer to do a certain task and solve problems.
Python is a High-Level Programming language. High-Level means the language is closer to human language instead of machine language (more independent of a particular type of computer). It was created in 1991 by a guy named Guido van Rossum and it was designed to emphasize code readability.
Some Applications of Python Programming:
Programming can perform almost anything!
Syntax is a set of rules defined by the programming language. Syntax is essential in letting your computer understand exactly what you are trying to say in your code. If you do not follow these set of rules, you may come across syntax error, and your programme may not work correctly.
Examples of syntax errors:
Unit 1 will cover the basic syntax of Python programming.
Each sub-unit comprises of an explanation section, Exercises section, Video Guide section and Further Readings.
We recommend that you go through the explanation section and attempt the exercises. The video guide and further readings acts as a supplement to the basic information that is required for you to complete the activities.
Examples will be shown using embedded trinket.io interpreter.
Python can be run using Integrated Development Environment (IDE) / Integrated Development Learning Environment (IDLE).
IDE is a software environment which usually consist of a software development package containing Code Editor, Build Automation, Tools and Debugger. IDLE is the specific IDE for Python.
We will use IDEs to write, read and execute Python codes so that we can perform the tasks we require.
Browser-based IDEs (Beginner friendly!) :
Types of IDEs that you can download for Python :
Steps to install and create your first workbook (PDF with step by step illustration available in Downloads Box)