# Python Onramp

Welcome to the Python Onramp! Since REII 211 has transitioned from C to Python, this guide is designed to bridge the gap quickly so we can focus on the "meat" of the course: Algorithms.

***

## Choose Your Path

## Where Should You Start?

| **New to Python?**                                                                                                                                                                                                         | **Python Pro?**                                                                                                                                                                            |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p><strong>Goal: Build a Foundation</strong><br>Work through the <strong>entire</strong> Jupyter notebook. Python is more concise than C, but the way it handles lists and memory is different. Don’t skip the basics.</p> | <p><strong>Goal: Verify Skills</strong><br>If you’ve used Python before, skip the explanations and jump straight to the <strong>Problem Questions</strong> at the end of the notebook.</p> |

***

## Getting the Notebook

{% hint style="warning" %}

#### Download from eFundi

The actual notebook file `PythonOnramp.ipynb` is hosted on **eFundi under Assignments**.

**Why?** This file is updated regularly with new examples and fixes. Always ensure you are working on the latest version from the official portal.
{% endhint %}

***

## How to Get Started

{% tabs %}
{% tab title="1. Open in VSCode" %}

1. **Open VSCode** and press `Ctrl+O` (or `Cmd+O`).
2. Navigate to your downloaded `PythonOnramp.ipynb`.
3. When prompted for a **Kernel**, select your Python 3.12 interpreter.
   {% endtab %}

{% tab title="2. Running Cells" %}

* **Read & Run:** Click the "Play" icon next to a cell or press `Shift + Enter`.
* **State Matters:** Remember that variables defined in a top cell stay in memory for the cells below!
  {% endtab %}

{% tab title="3. Experiment" %}
Don't just read. **Break the code.** Change variables, swap loop types, and see how the error messages differ from the C compiler.
{% endtab %}
{% endtabs %}

***

## Help & Troubleshooting

**Stuck on something?**

* Review the examples in the notebook
* Try running the code in smaller pieces to understand each part
* Ask questions during practical sessions

**Common Issues**:

* **Kernel not connecting**: Restart VSCode or select a different Python interpreter
* **Cell won't run**: Make sure you ran all previous cells in order
* **Import errors**: Make sure your Python installation is complete

***

## Learning Objectives

By the end of this onramp, you should be able to:

* Implement a logic gate in Python without semicolons.
* Understand Python's **list slicing** (you'll love this compared to C arrays).
* Write and call functions with multiple return values.

***

{% hint style="success" %}
**Finished the Exercises?** Once you've cleared the Problem Questions, you're ready for the first real challenge: [Move to Study Unit 1: Introduction to Analysis →](https://seece.gitbook.io/reii211/study-units/unit-1)
{% endhint %}
