Python course: Introduction And Basic Data Types

Getting Started with Python, which covers an introduction to Python, installing Python on your computer, using Python interpreters and Integrated Development Environments (IDEs), and writing your first Python program (Hello World!).

1. Introduction to Python:

Python is a high-level, interpreted programming language known for its simplicity and readability. It supports multiple programming paradigms like procedural, object-oriented, and functional programming.

2. Installing Python:

To follow along with this tutorial, we will install Visual Studio Code (VS Code) and set it up for Python development. Open your web browser and go to the (Visual Studio Code website). Then click on the download button for your operating system (Windows, macOS, or Linux). Windows: Run the downloaded installer and follow the prompts. macOS: Open the downloaded .dmg file and drag the VS Code icon to the Applications folder. Linux: Follow the instructions provided on the download page for your specific Linux distribution. Now lets visit the Python Website. Open your web browser and go to the ( Python downloads page). Do the same as we did before with VS Code, follow the prompts.

3. Set Up Python in Visual Studio Code:

Launch VS Code from your applications or start menu. Click on the Extensions view icon on the sidebar (or press Ctrl+Shift+X). In the search box, type "Python". Find the Python extension by Microsoft and click "Install". Open the integrated terminal in VS Code by selecting Terminal > New Terminal from the top menu (or pressing `Ctrl+``). In the terminal, type python --version (or python3 --version if you're on macOS or Linux) and press Enter. You should see the version of Python you installed.

Now lets run a simple script:

Code

print("Hello, Python!")

Output

Hello, Python!

This is the best thing to learn first, the Print() function. This function will output whatever you put in the peramiters, now lets learn about what kind of stuff you can put in these peramiters. First we need to learn about the three most common data types.

Understanding Strings, Integers, and Floats in Python Introduction:

In Python, data is stored in different types, depending on what kind of value you’re working with. The three most common types are: Strings (str) – Used for text. Integers (int) – Used for whole numbers. Floats (float) – Used for decimal numbers. Let’s go through each one in detail. 1. Strings (str) – Text Data A string is a sequence of characters enclosed in either single (' or ") or triple (''' or """) quotes.

Examples:

name = "Grant" greeting = 'Hello, world!' paragraph = """This is a multi-line string."""

Key Features of Strings:

Strings can contain letters, numbers, symbols, and spaces. You can use single or double quotes interchangeably. Triple quotes (''' or """) allow multi-line strings.

Integers (int) – Whole Numbers

An integer is any whole number, positive or negative, without decimals.

Examples:

age = 25 temperature = -10 year = 2025

Key Features of Integers:

They cannot have decimal points. They can be positive, negative, or zero.

Floats (float) – Decimal Numbers

A float is a number that contains a decimal point.

Examples:

price = 19.99 gpa = 3.75 temperature = -5.2