From ab76d554643e049f1c2edf911367ae0948967a43 Mon Sep 17 00:00:00 2001 From: Tom Fynes Date: Thu, 9 Apr 2026 06:14:05 +0100 Subject: [PATCH 1/3] resolving emails and adding grade 1 python --- SECURITY.md | 2 +- git_101/Grade 2/git_log.md | 4 +- python_101/Grade 1/01 What is Python.md | 39 ++++++ python_101/Grade 1/02 Your first script.md | 93 ++++++++++++++ .../Grade 1/03 Variables and data types.md | 115 ++++++++++++++++++ python_101/Grade 1/04 User input and print.md | 92 ++++++++++++++ src/pages/career.js | 2 +- src/pages/index.js | 4 +- src/theme/Footer/index.js | 46 +++++-- 9 files changed, 381 insertions(+), 16 deletions(-) create mode 100644 python_101/Grade 1/01 What is Python.md create mode 100644 python_101/Grade 1/02 Your first script.md create mode 100644 python_101/Grade 1/03 Variables and data types.md create mode 100644 python_101/Grade 1/04 User input and print.md diff --git a/SECURITY.md b/SECURITY.md index 5a9bdcc..7ea7406 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -6,7 +6,7 @@ If you discover a security issue in a Fynes Forge project, please report it responsibly: -1. Email **tf.dev@icloud.com** with the subject line: `[SECURITY] ` +1. Email **contact@fynesforge.dev** with the subject line: `[SECURITY] ` 2. Include: a description of the vulnerability, steps to reproduce, and the potential impact 3. You will receive a response within 5 business days diff --git a/git_101/Grade 2/git_log.md b/git_101/Grade 2/git_log.md index 8a80752..7c59da4 100644 --- a/git_101/Grade 2/git_log.md +++ b/git_101/Grade 2/git_log.md @@ -29,13 +29,13 @@ git log Output: ```yaml commit a3f6f1c9e29a3e82a4dcb3f59e8ab3d28a12c9af -Author: Tom Fynes +Author: Tom Fynes Date: Fri May 24 14:15 2025 Add styling to navigation bar commit d1e8f91b45e8e1f9e4aa84b2e1830c4b5d674cd0 -Author: Tom Fynes +Author: Tom Fynes Date: Fri May 24 13:50 2025 Initial commit: add version.txt diff --git a/python_101/Grade 1/01 What is Python.md b/python_101/Grade 1/01 What is Python.md new file mode 100644 index 0000000..9f20176 --- /dev/null +++ b/python_101/Grade 1/01 What is Python.md @@ -0,0 +1,39 @@ +# What is Python + +**Python** is a high-level, general-purpose programming language known for its clean and readable syntax. It was created by Guido van Rossum and first released in 1991, and has since grown into one of the most widely used languages in the world. + +### Why Python? + +- **Readable**: Python code reads almost like plain English, which makes it easier to learn and maintain. +- **Versatile**: Python is used across web development, automation, data engineering, data science, machine learning, and more. +- **Large Ecosystem**: There are thousands of libraries and packages available to extend what Python can do out of the box. +- **In Demand**: Python consistently ranks as one of the most sought-after skills in data and engineering roles. + +### Python in Data Roles + +For data engineers, analysts, and scientists, Python is a core tool. It is used to: + +- Read, clean, and transform data +- Automate repetitive tasks and pipelines +- Interact with APIs and databases +- Build and train machine learning models +- Create visualisations and reports + +### Python Versions + +Python 2 reached end-of-life in 2020 and should not be used. This course uses **Python 3**, specifically 3.10 or higher. If you see `python` and `python3` used interchangeably, they refer to the same thing — the difference is covered in the setup guides. + +### How Python Runs + +Python is an **interpreted** language. This means code is executed line by line at runtime, rather than compiled into a binary first. You write a `.py` file, hand it to the Python interpreter, and it runs. + +``` +your_script.py → Python interpreter → output +``` + +This makes Python quick to write and test, at the cost of being slower than compiled languages like C or Go for heavy computation. In practice, this rarely matters for the work covered in this course. + +### Practice Exercises + +* In your own words, write down one reason why Python is popular in data engineering. +* Look up one Python library used in data work that interests you and note what it does. diff --git a/python_101/Grade 1/02 Your first script.md b/python_101/Grade 1/02 Your first script.md new file mode 100644 index 0000000..136f7e8 --- /dev/null +++ b/python_101/Grade 1/02 Your first script.md @@ -0,0 +1,93 @@ +# Your First Script + +### Introduction +A Python script is simply a text file with a `.py` extension. The Python interpreter reads and executes it from top to bottom. This section covers how to write, save, and run your first script. + +### Hello, World + +The traditional first program in any language — print a message to the screen. + +#### In the Terminal (Interactive Mode) + +Python comes with an interactive shell called the REPL (Read-Eval-Print Loop). You can use it to run single lines of code immediately. + +```bash +python +``` + +```python +>>> print("Hello, World!") +Hello, World! +``` + +Type `exit()` or press `Ctrl+D` to leave the REPL. + +#### As a Script File + +Create a file called `hello.py` and add the following: + +```python +print("Hello, World!") +``` + +Run it from the terminal: + +```bash +python hello.py +``` + +**Output** + +``` +Hello, World! +``` + +### Comments + +Comments are lines Python ignores — they are there for the reader, not the interpreter. Use them to explain what your code is doing. + +```python +# This is a single-line comment +print("Hello!") # This comment is at the end of a line + +""" +This is a multi-line string. +It is often used as a block comment or docstring. +""" +``` + +### The print() Function + +`print()` outputs values to the terminal. It can print strings, numbers, variables, and more. + +```python +print("Hello, World!") +print(42) +print("The answer is", 42) +print("Line one\nLine two") # \n creates a new line +``` + +**Output** + +``` +Hello, World! +42 +The answer is 42 +Line one +Line two +``` + +### Running Scripts vs the REPL + +| | REPL | Script file | +|--|------|-------------| +| Good for | Quick tests, exploring | Real programs, saving work | +| How to run | Type `python` | `python filename.py` | +| Output shown automatically | ✅ | Only via `print()` | + +### Practice Exercises + +* Create a file called `grade1.py` and print your name to the terminal. +* Add a comment above the print statement explaining what it does. +* Print three separate lines of output using three `print()` calls. +* Print two values in a single `print()` call separated by a space. diff --git a/python_101/Grade 1/03 Variables and data types.md b/python_101/Grade 1/03 Variables and data types.md new file mode 100644 index 0000000..c5617a5 --- /dev/null +++ b/python_101/Grade 1/03 Variables and data types.md @@ -0,0 +1,115 @@ +# Variables and Data Types + +### Introduction +Variables are used to store values so you can refer to them later in your code. Python is dynamically typed, which means you do not need to declare a type — Python works it out from the value you assign. + +### Assigning Variables + +```python +name = "Alice" +age = 30 +salary = 75000.50 +is_active = True +``` + +Variable names should be lowercase, with words separated by underscores. This is called **snake_case** and is the Python convention. + +### Core Data Types + +#### String (`str`) +Text data, enclosed in single or double quotes. + +```python +firstname = "Alice" +greeting = 'Hello, World!' +``` + +You can combine strings using `+`: + +```python +full_name = "Alice" + " " + "Smith" +print(full_name) # Alice Smith +``` + +Or use an **f-string** (the preferred modern approach): + +```python +firstname = "Alice" +lastname = "Smith" +print(f"Full name: {firstname} {lastname}") # Full name: Alice Smith +``` + +#### Integer (`int`) +Whole numbers, positive or negative. + +```python +age = 30 +year = 2024 +negative = -10 +``` + +#### Float (`float`) +Numbers with a decimal point. + +```python +salary = 75000.50 +temperature = -3.5 +``` + +#### Boolean (`bool`) +One of two values: `True` or `False`. Note the capital letter. + +```python +is_active = True +has_contract = False +``` + +#### NoneType (`None`) +Represents the absence of a value. + +```python +contract_end_date = None +``` + +### Checking the Type of a Variable + +```python +name = "Alice" +age = 30 +salary = 75000.50 + +print(type(name)) # +print(type(age)) # +print(type(salary)) # +``` + +### Type Conversion + +You can convert between types when needed. + +```python +age_str = "30" +age_int = int(age_str) # "30" → 30 +price_str = str(19.99) # 19.99 → "19.99" +whole = int(3.9) # 3.9 → 3 (truncates, does not round) +``` + +### Common Mistakes + +* Forgetting quotes around strings: `name = Alice` → `NameError` +* Mixing types without converting: `"Age: " + 30` → `TypeError` + +```python +# Correct way +age = 30 +print("Age: " + str(age)) +# Or, more cleanly: +print(f"Age: {age}") +``` + +### Practice Exercises + +* Create variables for your `firstname`, `lastname`, `age`, and `salary`. Print them all on one line using an f-string. +* Create a variable with the value `"42"`. Convert it to an integer and add `8` to it. Print the result. +* Print the type of each of the four variables you created. +* Create a variable called `is_employed` and set it to `True`. Print it. diff --git a/python_101/Grade 1/04 User input and print.md b/python_101/Grade 1/04 User input and print.md new file mode 100644 index 0000000..a1d4fe3 --- /dev/null +++ b/python_101/Grade 1/04 User input and print.md @@ -0,0 +1,92 @@ +# User Input and Print + +### Introduction +Programs often need to communicate with the person running them — either by displaying output or asking for input. This section covers the `print()` function in more detail and introduces `input()` for reading user input. + +### print() in Depth + +`print()` can take multiple arguments and has optional keyword arguments to control formatting. + +```python +print("Hello", "World") # Hello World +print("Hello", "World", sep="-") # Hello-World +print("Loading", end="...") # Loading... (no newline) +print("done") # done +``` + +**Formatting numbers** + +```python +salary = 75234.5678 +print(f"Salary: {salary:.2f}") # Salary: 75234.57 +print(f"Salary: {salary:,.2f}") # Salary: 75,234.57 +``` + +### input() + +`input()` pauses the program and waits for the user to type something and press Enter. It always returns a **string**. + +#### Syntax + +```python +variable = input("Prompt message: ") +``` + +**Example** + +```python +name = input("Enter your name: ") +print(f"Hello, {name}!") +``` + +``` +Enter your name: Alice +Hello, Alice! +``` + +### input() Always Returns a String + +If you need a number from the user, you must convert it. + +```python +age_input = input("Enter your age: ") +age = int(age_input) +print(f"In 10 years you will be {age + 10}") +``` + +Or on one line: + +```python +age = int(input("Enter your age: ")) +``` + +> If the user types something that cannot be converted (e.g. `"hello"` when you call `int()`), Python will raise a `ValueError`. Error handling is covered in Grade 6. + +### Combining input() and print() + +```python +firstname = input("First name: ") +lastname = input("Last name: ") +salary = float(input("Salary: ")) + +print(f"\nEmployee Summary") +print(f"Name: {firstname} {lastname}") +print(f"Salary: £{salary:,.2f}") +``` + +``` +First name: Alice +Last name: Smith +Salary: 75000 + +Employee Summary +Name: Alice Smith +Salary: £75,000.00 +``` + +### Practice Exercises + +* Ask the user for their name and favourite number. Print a sentence using both. +* Ask the user for two numbers. Add them together and print the result. +* Print a formatted receipt: ask for an item name and price, then print them aligned neatly using an f-string. +* Ask the user for their year of birth. Calculate and print their approximate age. diff --git a/src/pages/career.js b/src/pages/career.js index 30ec50b..a476e1a 100644 --- a/src/pages/career.js +++ b/src/pages/career.js @@ -19,7 +19,7 @@ const ACCENT = "#DD7596"; const PERIWINKLE = "#B7C3F3"; const PALE_BLUE = "#AED6F1"; const MAGENTA = "#ECDA90"; -const CONTACT_EMAIL = "tf.dev@icloud.com"; +const CONTACT_EMAIL = "contact@fynesforge.dev"; // ─── Data ────────────────────────────────────────────────────────────────────── diff --git a/src/pages/index.js b/src/pages/index.js index cc50803..4ef126d 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -189,7 +189,7 @@ export function HomepageHeader() {