Course Overview

/

Python Strings and Integers

Python - Strings and Integers

To begin our introduction to Python scripting, it is important to check that Python is installed on your machine. This can be achieved by running the following command:

If Python is not installed on your machine you can install it with the following command:

Starting our first script

Our first script will explore Strings and integers. These are important terms in coding and scripting, they refer to data types that can be used throughout a script.

A string is a sequence of characters, these can be either alphabetic, numerical, or special characters. In Python, strings are enclosed in quotation marks. Both single quotes (‘) or double quotes (“) can be used.

An integer is a whole number that can be either positive or negative. In Python it is not necessary to enclose integers in any form of quotation marks.

1st Python Script

The first python script created is:

This will use the Python print function to be able to output the string “Hello, World” to the terminal and to print the output from the mathematical calculations within the brackets.

It is important to note that our python scripts will end in the extension .py