,

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

·

Laptop showing a code editor with a Python logo and a play button

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.

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, open Downloads and get the latest stable version.
  2. Run the installer. Before clicking anything else, tick the box that says "Add Python to PATH". Skipping this is the number one beginner mistake, and it causes the classic "python is not recognized" error.
  3. Click Install Now and wait for the success message.

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 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.


Found this useful? Share it:

Leave a Reply

Keep reading

Discover more from AI and Engineering Insights

Subscribe now to keep reading and get access to the full archive.

Continue reading