Python Tutorial

The language we start most beginners on. Variables through to reading files, with the mistakes we watch people make in class.

Lessons:6Reading time:29 minCost:Free, no sign-up

What this covers

Python is the language we put in front of most people who have never written code, and the reason is simple: you can do something useful in it on the first afternoon. There are no semicolons to forget, no type declarations to argue with, and the error messages are close to English.

These lessons cover what a first term of Python actually needs — variables, loops, lists, functions, dictionaries and files. They are short on purpose. Each one answers a single question, shows the code, and names the mistake that sends students to the mentor's desk, because that is the part you will not find in the documentation.

Work through them in order if you are starting out. If you arrived from a search for one thing, read that one and ignore the rest — nothing here depends on you having read the page before it.

After these lessons you can

  • Read and write Python that uses variables, loops, functions and dictionaries without copying from a tutorial
  • Understand why two names can point at the same list, and when that will bite you
  • Open, read and write files safely, including CSV
  • Recognise the handful of beginner mistakes that cause most of the errors you will hit
  • Know when a list comprehension is clearer than a loop, and when it is not

Where Python is actually used

Including the part most course pages leave out: what it is the wrong tool for.

Backend and APIs

Django and FastAPI are both Python. Most of the web work we do for clients that is not WordPress is Python on the server.

Data and machine learning

pandas, scikit-learn and every serious ML library are Python first. If you are heading towards data, this is the entry point and not a detour.

Automation

The unglamorous one that pays quickest: renaming five hundred files, pulling a report every Monday, scraping a price list. Office workers get more out of this than developers do.

Not for

Phone apps and anything that has to run in a browser. Python is the wrong tool for both; JavaScript or React Native is the right one.

Before you start

Should I learn Python or C++ first?

Python, unless your college examines C++ this semester — in which case do both, starting with Python for a month. Python teaches you to think about the problem. C++ teaches you what the machine is doing. In that order, the second one is far less painful.

How long does it take to learn Python?

You can write useful scripts in three or four weeks of regular practice. Being employable with it takes months, because the language is the small part — databases, deployment and reading someone else's code are the rest. Anyone selling you 'Python in 7 days' is selling the syntax and calling it the skill.

Do I need maths for Python?

No, not for the language and not for web or automation work. You need it for machine learning, where the maths is the actual subject and Python is just how you type it.

Is Python enough to get work?

On its own, rarely. Python plus one framework and the ability to deploy what you built is a different conversation. That gap — from a script that runs on your laptop to something live on a server — is most of what our course spends its time on.

Learn Python with someone in the room

These pages explain the idea. The hard part is the hour where your own code will not run and you cannot see why — and that is the part a class is for. WebPrims is on Majitha Road, Amritsar. Come and sit one before you pay anything.