# Learn Python from scratch as a student

> Learn Python from zero as a student: free places to learn, install it and write a first program, an 8-week plan, projects by major and beginner mistakes.

![Learn Python from scratch as a student](https://tiswa.app/assets/blog/learn-python/learn-python-cover-en.webp)

## Where to learn Python for free

| Resource | Language | Best for | Note |
|---|---|---|---|
| [Satr](https://satr.tuwaiq.edu.sa/) | Arabic | Starting from zero in Arabic | Completely free, with a badge on your profile after each course |
| [Harvard CS50 Python](https://cs50.harvard.edu/python/) | English | A structured, university-style course | Free via OpenCourseWare, ten weeks, a browser is enough |
| [Official Python tutorial](https://docs.python.org/3/tutorial/index.html) | English | After you know programming basics | Written for programmers new to Python, not beginners new to programming |

![Comparison card of the guide table](https://tiswa.app/assets/blog/learn-python/learn-python-inline-2-en.webp)


CS50's Introduction to Programming with Python is designed for students with or without prior experience. It covers functions, variables, conditionals and loops, then exceptions, testing, libraries, regular expressions, classes and files. Each week has a lecture, short videos and a problem set to submit. If you want a verified certificate, that is a separate option through edX. The official Python tutorial describes itself as written for programmers who are new to the language, so keep it as a reference for later.

## Install Python and write your first program

1. **Download Python**: Go to python.org/downloads and download the latest version for your machine, Windows or macOS.
2. **Install**: Run the installer. On Windows, tick the option to add Python to PATH if it appears.
3. **Open IDLE**: Python comes with IDLE, its own Integrated Development and Learning Environment. Open it from your apps.
4. **Write your first line**: In the IDLE window type print("Hello") and press Enter. If the text appears, congratulations, you wrote your first program.
5. **Save a file**: From File choose New File, write your program, save it as something like hello.py, and run it from Run.

![5-step flow: Download Python / Install / Open IDLE / Write your first line / Save a file](https://tiswa.app/assets/blog/learn-python/learn-python-inline-1-en.webp)


> **Tip**: No laptop yet? CS50 Python says all you need is a web browser, so you can start on any computer in your university library. Later, an editor like JetBrains PyCharm makes life easier, and you can get it through the [GitHub Student Developer Pack](https://tiswa.app/en/blog/github-student-developer-pack/).

## An 8 week plan

One hour a day, five days a week. Each week ends with a small project you upload to GitHub.

| Week | Topic | Project |
|---|---|---|
| 1 | print, variables, types and input | A program that asks your name and age and replies |
| 2 | if, else and logic | A GPA calculator that gives you your grade |
| 3 | for and while loops | A number guessing game |
| 4 | Lists and dictionaries | A to-do list you can add to and remove from |
| 5 | Functions | Split week 4's program into tidy functions |
| 6 | Files and errors | Save the to-do list to a file and handle bad input |
| 7 | Libraries | A program that reads a CSV file and prints a summary |
| 8 | A project from your major | A tool that solves a real problem in your studies |

## Project ideas by major

- Business and accounting: a program that reads your monthly spending from a file and works out the percentages.
- Engineering: a calculator for formulas from a course you are taking this term.
- Health sciences: a tool that converts between lab units.
- Computer science: a simple bot that answers frequent questions.
- Any major: a program that builds your study schedule around exam dates.

If you get stuck, use AI as a tutor, not a homework solver. Here is a template that helps:

Private Python tutor:

```
I am learning Python from scratch and I have reached [topic]. Here is my code and the error I get: [paste code and error]. Do not write the solution. Ask me one question that brings me closer to understanding the problem, wait for my answer, then give me a hint. When I solve it, give me a slightly harder exercise on the same idea.
```

## How to tell you are improving

Progress in coding is not the number of lessons you watched, it is the programs you can write on your own. Signs you are on track: you can write the week's program without checking the lesson on every line, you understand an error message and fix it, and you can explain to a classmate what your code does. For a clearer measure, solve the CS50 problem sets yourself and submit them, or try challenges on Tuwaiq Academy's CoderHub with your Satr account.

## Beginner mistakes

- Watching lots of lessons and writing little code. The rule: type every lesson yourself and change it.
- Jumping to another language before the basics are solid. Stay with Python until the plan is done.
- Being scared of error messages. Read the last line first, it usually tells you exactly what is wrong.
- Copying ready-made solutions. If you copy one, close it and write it again from memory.

## After Python, what next?

Once the basics are done, pick a direction: learn data analysis if you like numbers, learn SQL to work with databases, or [learn HTML and CSS](https://tiswa.app/en/blog/learn-html-css/) if you want to build websites. Put everything on GitHub from day one, read [GitHub for beginners](https://tiswa.app/en/blog/github-for-beginners/). The full picture is in [how to learn programming from zero](https://tiswa.app/en/blog/learn-programming-from-zero/).

## Your first error messages and what they mean

SyntaxError usually means a typo in the line, such as a missing bracket or colon. IndentationError means the spaces at the start of a line are wrong. NameError means you used a name you never defined or spelled it differently. TypeError means an operation on two types that do not fit, such as adding text to a number. Read the last line of the error first; it names the error, and the line above it shows where.

Tiswa gathers free and discounted student offers in Saudi Arabia in one place: developer tools, student prices on laptops, and food and transport deals. Verify once. [Join Tiswa](https://tiswa.app/en/join/)

## Questions

### Is Python free?

Yes. You download it from python.org for your machine, and it comes with IDLE, an environment to write your programs in.

### How long does it take to learn Python basics?

At one hour a day, five days a week, you can cover the basics in about 8 weeks if you practise with small projects.

### Is there a free Arabic resource for Python?

Satr from Tuwaiq Academy is completely free and starts from zero with no prior experience needed.

### Is CS50 Python free?

Yes, you can take it for free through Harvard's OpenCourseWare. A verified certificate is a separate option through edX.

### Do I need a powerful laptop?

No. CS50 Python says a web browser is all you need, and any Windows or macOS machine runs Python.

### Should I start with the official Python tutorial?

The official tutorial says it is for programmers new to Python, not beginners new to programming. Start with Satr or CS50 and keep it as a reference.


## Sources

[^1]: python.org, https://www.python.org/downloads/
[^2]: docs.python.org, https://docs.python.org/3/tutorial/index.html
[^3]: docs.python.org, https://docs.python.org/3/library/idle.html
[^4]: cs50.harvard.edu, https://cs50.harvard.edu/python/
[^5]: satr.tuwaiq.edu.sa, https://satr.tuwaiq.edu.sa/
[^6]: sites.satr.codes, https://sites.satr.codes/faq?platform=SATR
