,

Python for Beginners: Install, Pick an IDE and Write Your First Program

·

· Updated

Laptop with Python code and Python logo, Python basics for engineers cover illustration

Quick answer: to start Python, install the latest Python 3 from python.org (on Windows, check it with python --version or py --version), pick a beginner-friendly editor such as Thonny or the browser-based Google Colab, then create hello.py with a print() line and press Run. Move to VS Code once you’re comfortable. No installation is needed if you start in Colab.

What if the programming language behind ChatGPT-style tools, Netflix recommendations and half the engineering software on Earth was named after a comedy show? It was. Python is named after the British comedy group Monty Python, not the snake, which tells you a lot about the culture: serious power, very little stuffiness.

If you are a student, a mechanical engineer or a complete beginner who wants to get into AI, Python is the first door to open. In this guide we will do three things in about ten minutes of actual work: install Python, understand what an IDE is (and pick one), and run your first program.

Key takeaways

  • Install Python 3 from python.org. On Windows, the Python install manager gives you the py command; on Mac and Linux, use python3.
  • An IDE (Integrated Development Environment) is the workshop where you write and run code: an editor, a run button, error messages and a debugger in one place.
  • Best free starting points: Thonny for absolute beginners, Google Colab if you cannot install anything, and VS Code for long-term use.
  • Your first program takes about ten minutes, and indentation (spaces) is part of Python’s grammar.

Why Python for AI and engineering?

Python was created by Guido van Rossum and first released in 1991. It became the favourite of data scientists because it reads almost like English, and because a huge collection of free libraries (NumPy, pandas, scikit-learn, PyTorch and more) does the heavy lifting for you. You write five lines; a library written by experts does the thousand lines underneath.

For engineers it is a bonus: the same language can crunch sensor data from a test bench, plot a gear-ratio chart or train a small model, all without a single semicolon.

Step 1: How to install Python

On Windows:

  1. Go to the official website, python.org, and open Downloads. For Python 3.14 and newer, the recommended option is the Python install manager; download and run it.
  2. Follow the prompts to install the latest stable version. The install manager gives you the py command, which runs Python even if it is not added to PATH. If it offers to add Python to PATH, saying yes lets you type python as well.
  3. Using the older traditional installer instead? Tick the box that says "Add Python to PATH" before clicking Install Now. Skipping it causes the classic "python is not recognized" error.

On macOS: download the installer from python.org and follow the prompts.

On Linux: Python is usually already installed. Check by typing python3 --version in the terminal.

Check that it worked: open Command Prompt (or Terminal) and type:

python --version

If you see a version number, congratulations, you now own a programming language. On Windows, if python is not recognised, type py --version instead; the py command works even when Python is not on your PATH. On Mac and Linux you may need to type python3 instead of python.

Can’t install anything on your laptop? Skip to Google Colab below. It runs Python in your browser for free.

Step 2: What is an IDE?

IDE stands for Integrated Development Environment. That sounds scary, so here is the plain version: Python is the language, and an IDE is the workshop where you write it.

You could write code in Notepad, the same way you could cut a steel plate with a butter knife. An IDE gives you the proper tools in one place: a text editor that colours your code, a button to run it, error messages that point to the exact line, autocomplete that finishes your words, and a debugger that lets you pause the program and look inside. Same job, far fewer tears.

Step 3: The best IDEs for beginners

ToolBest forCostVerdict
ThonnyAbsolute first-timersFreeVery simple, shows what each line does. Great for week one.
VS CodeLong-term everyday useFreeLight, popular, works for Python and much more. Install the Python extension.
Google ColabNo install, AI experimentsFree tierRuns in the browser and can offer a free GPU for small projects (availability varies).
Jupyter Notebook / JupyterLabData analysis and learningFreeRun code in small cells and see charts right below.
PyCharm CommunityBigger Python projectsFreePowerful, a bit heavy for beginners.

My suggestion: start with Thonny or Google Colab this week, and move to VS Code once you are comfortable. Don’t spend three days choosing an IDE. That is called procrastination wearing a productivity hat.

Step 4: Your first program

Open your IDE, create a new file called hello.py and type this:

name = "Engineer"
print("Hello,", name)

# A tiny engineering calculation
wheel_diameter_m = 0.28
rpm = 3000
speed_kmh = 3.14159 * wheel_diameter_m * rpm * 60 / 1000
print("Speed in km/h:", round(speed_kmh, 1))

Press Run. You should see a greeting and a speed of about 158 km/h. Congratulations, you just wrote a program that does real engineering maths.

What did you just learn?

  • Variables (name, rpm) are labelled boxes that hold values.
  • print() shows something on the screen.
  • Comments start with #. Python ignores them, but your future self will thank you.
  • Operators like * and / do the maths.

Two Python quirks that trip up every beginner

1. Spaces matter. Most languages use curly brackets to group code. Python uses indentation (the blank space at the start of a line). If your spacing is wrong, the program refuses to run. Yes, really: whitespace is part of the grammar.

if rpm > 2500:
    print("Engine is working hard")   # 4 spaces = inside the if

2. Errors are normal. Your first error message will feel like an insult. It isn’t. Read the last line of it first; it usually tells you what went wrong and where. Professional programmers see errors all day long. They just have calmer faces.

A hidden treat

Type import this in Python and press Run. It prints a short poem called The Zen of Python, a list of design principles such as "Readability counts" and "Simple is better than complex". It is one of the language’s famous Easter eggs.

Your one-week starter plan

  1. Day 1: install Python and run hello.py.
  2. Day 2: learn variables, numbers and text.
  3. Day 3: learn if and else decisions.
  4. Day 4: learn loops (for and while).
  5. Day 5: learn lists and dictionaries.
  6. Day 6: write your own functions.
  7. Day 7: build a small tool, like a unit converter or a gear-ratio calculator.

Frequently asked questions

Do I need to be good at maths to learn Python?

No. Basic arithmetic is enough to start. The maths for machine learning can come later, step by step.

Is Python free?

Yes, Python itself and nearly all the tools in this guide are free and open source.

Which version should I install?

Python 3, the latest stable release from python.org. Python 2 is retired and should not be used.

Final thought

You don’t need to be a genius to learn Python. You need a working install, a friendly IDE and the patience to break things and fix them. Which IDE are you starting with? Drop it in the comments, and if you want the next step (variables, loops and lists with engineering examples), let me know.

Sources and further reading

Want a step-by-step plan for learning machine learning?

The 90-Day Machine Learning Roadmap takes you from Python basics to a deployed ML portfolio in 13 weeks, with a plan for every day and a progress tracker. Going for your first ML or data science job? The ML Career Bundle adds an interview kit, Python practice and resume templates.

Prefer video? Watch the tutorials on YouTube · Browse all toolkits


About the author. Anish Rane is an Application Engineer working on diesel engines and generator sets, with a mechanical engineering background, an MSc in Machine Learning & AI and a Data Science & AI specialization from IIT Bombay. Anish writes about where engineering meets machine learning: engines, gears and the Python models that help explain them. All guides by Anish · More about Anish

This guide is for learning. Check calculations against current standards and have safety-critical designs reviewed by a qualified engineer.

Found this useful? Share it:

6 responses to “Python for Beginners: Install, Pick an IDE and Write Your First Program”

Leave a Reply

Keep reading