Python Get Started

Python · Getting Started

Theory

Getting started means three things: installing a Python interpreter, picking a place to write code, and knowing how to run it. You can download Python from python.org, or install a distribution such as Anaconda that bundles Python with data libraries. Check the install from a terminal with python --version (on macOS and Linux the command is often python3; on Windows the py launcher also works).

There are two ways to run code. In interactive mode (the >>> REPL or a Jupyter notebook) each line or cell runs as soon as you press Enter, which is perfect for exploring data. In script mode you save code in a .py file and run it with python3 my_script.py, and the whole file executes top to bottom. Editors like VS Code or PyCharm add autocomplete, error highlighting and a debugger on top of either style.

Why we use it

You need a working interpreter and a comfortable editor before you can learn anything else. Knowing the difference between a notebook and a script saves confusion later, for example why a variable still exists in Jupyter after you deleted the cell that created it.

When to use it

Use a Jupyter notebook for exploration, charts and step-by-step learning. Use .py scripts in an editor for code that must run repeatedly, be scheduled or be shared. If python is not recognised, try python3 or py, or fix your PATH.

How it works

  1. Install Python (python.org or Anaconda)
  2. Open a terminal and run python --version
  3. Does it print a version number? Yes: Python is installed and ready. No: Try python3 or py, or fix PATH.
  4. Exploring data step by step? Yes: Open Jupyter and run code cell by cell. No: Write a .py file in VS Code.
  5. Run the script with python3 my_script.py
  6. Read the output (or the error) in the terminal

Syntax

python --version

Example

python3 my_script.py

Key points

Python topics

Getting Started

Variables & Data Types

Operators

Strings

Lists

Tuples

Sets

Dictionaries

Control Flow

Loops

Functions & OOP

Working with Data

Tooling & Errors

File Handling

Exception Handling

NumPy Library

Pandas Basics

Data Cleaning

Combining DataFrames (SQL Joins & Unions)

GroupBy & SQL-Style Analytics

Reshaping & Workflow

Data Visualization

Machine Learning (Scikit-Learn)

Advanced Python & AI

T
Tech Town
Log InSign Up Free
Home SQL Python DSA Power BI Snowflake Databricks Spark Gen AI Practice Problems Contest Blog

Python for Data Analysts

From basics to business insights — the complete step-by-step Python roadmap. Click any topic in the sidebar to open it right here.

{{ sectionCount }}
Sections
{{ topicCount }}
Topics
Free
Forever
Hands-on practice Practice Python Online 141 Python questions for data analysts — strings, records, dates, statistics and regex — with hidden tests and instant verdicts. Start practising →
Section {{ sec.num }}

{{ sec.label }}

Python  /  {{ current.sectionLabel }}  /  {{ current.name }}

{{ current.name }}

Theory

{{ current.def }}

Why we use it

{{ rich.why }}

When to use it

{{ rich.when }}

Diagram

{{ rich.dg.caption }}

{{ tb.title }}
{{ c.v }}
{{ rich.dg.op }}
➜
{{ rich.dg.output.title }}
{{ c.v }}
{{ nd.label }}
{{ nd.sub }}
{{ nd.label }}
{{ nd.sub }}
{{ rich.dg.left.title }}
{{ it }}
{{ rich.dg.right.title }}
{{ it }}
Flowchart — how it works
{{ nd.text }}
{{ nd.text }}
◇ {{ nd.text }}
Yes → {{ nd.yes }}
No → {{ nd.no }}
Syntax
{{ current.syntax }}
Example
{{ current.example }}
▶ Try It Live — runs real Python 3.12 in your browser (first run loads the engine)
{{ liveOutput }}
{{ liveError }}
Key Points — click to check off as you learn
  • {{ pt.mark }} {{ pt.text }}

Share this topic