Skip to content

Commit 55d3e9e

Browse files
committed
updated prompts on posts - formatting issues
1 parent cdeefe2 commit 55d3e9e

7 files changed

Lines changed: 48 additions & 25 deletions

_posts/30DaysOfPython/2025-12-18-python-day6.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ var_b = tuple() # This also creates one using a function.
3434

3535
I've explained that with tuples being immutable, we have many functions that we aren't able to do. So, for the latter part of this post I'll be writing functions that are used to access or check the information displayed within a tuple.
3636

37+
<!-- prettier-ignore -->
3738
> Tip: You _can_ change a tuple to another collection data type like list, then modify it, and then change the new list with modified items in to a tuple.
38-
> {: .prompt-tip}
39+
{: .prompt-tip}
3940

4041
## Accessing Items in a Tuple
4142

@@ -81,8 +82,9 @@ lst = ("Item1", "Item2", "Item3")
8182
print(lst[0:2:1]) # ["Item1", "Item2"]
8283
```
8384

85+
<!-- prettier-ignore -->
8486
> I've just realised that the method used to slice should really be referred to as [start:stop:step] not "skip" as it selects the data it lands on.
85-
> {: .prompt-tip}
87+
{: .prompt-tip}
8688

8789
## Changing Collection Data Types
8890

@@ -114,8 +116,9 @@ lst2 = ("Item3", "Item4") + lst1 # Concatenating tuples
114116
print(lst2) # ("Item3", "Item4", "Item1", "Item2") # printed in the order it is inserted.
115117
```
116118

119+
<!-- prettier-ignore -->
117120
> **Tip**: I have also learnt that you can join different list types together but must first change or specify the list to being the type you require.
118-
> {: .prompt-tip}
121+
{: .prompt-tip}
119122

120123
```python
121124
lst1 = ["Item1"]

_posts/30DaysOfPython/2025-12-18-python-day7.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ Again, like with lists and tuples, you can create a set using initial values or
3030
lst = set()
3131
```
3232

33+
<!-- prettier-ignore -->
3334
> **Update**: Using `lst = {}` won't work as this creates a dictionary, not a set.
34-
> {: .prompt-warning}
35+
{: .prompt-warning}
3536

3637
## Accessing Items In a Set
3738

@@ -166,8 +167,9 @@ print(lst1.difference(lst2)) # Kiwi
166167
print(lst1.symmetric_difference(lst2)) # {"Grapes", "Kiwi"}
167168
```
168169

170+
<!-- prettier-ignore -->
169171
> **Note**: `difference()` uses one set against another to compare, whereas `symmetric_difference()` uses both to compare and returns items that are unique in each set.
170-
> {: .prompt-tip}
172+
{: .prompt-tip}
171173

172174
We can also use `isdisjoint()` to provide a boolean response to see if two sets contain similar items. If they do then we can't join them, if they don't we can.
173175

_posts/30DaysOfPython/2025-12-18-python-day8.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: post
33
title: Dictionaries - Storing Data Like a Database, Right In Python...
44
description: >-
5-
While the title of this blog implies that a dictionary list in Python is a database, it's not. How it works, however, is very close to that of a database. Each entry stored has its own 'Key':'Value'. The key to each value is used to perform functions, replacing the need for indices. Here's what I've learnt about dictionaries on Day 8.
5+
While the title of this blog implies that a dictionary list in Python is a database, it's not. How it works, however, is very close to that of a database. Each entry stored has its own 'Key':'Value'. The key to each value is used to perform functions, replacing the need for indices. Here's what I've learnt about dictionaries on Day 8.
66
author: Sheikh Hussain
77
date: 2025-12-26 17:00:00 +0000
88
categories: [Python, Courses]
@@ -12,7 +12,6 @@ math: false
1212
mermaid: false
1313
image:
1414
  path: 012026/python_day8.jpg
15-
  # lqip: data:image/...
1615
  alt: Image from Pexels - Python Programming
1716
render_with_liquid: false
1817
media_subpath: /assets/img/posts/

_posts/30DaysOfPython/2025-12-20-python-day2.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ When creating a variable, we would use a principle to follow that helps create a
3232

3333
By now we should have already gone over how to load a development environment on your device to start coding with Python.
3434

35+
<!-- prettier-ignore -->
3536
> If you haven't yet installed both Python and VSCode, read this post: [Introduction To Python](https://sheikh-h.github.io/Blog/posts/python-day1/)
36-
> {: .prompt-info }
37+
{: .prompt-info }
3738

3839
I'll use actual code examples to show you how you can;
3940

@@ -62,13 +63,15 @@ Here is a comprehensive guideline to creating a Python Variable with the right n
6263
- **Can** be alpha-numeric (letters & numbers) and have underscores
6364
- Should represent or be named something **relative** to the **information stored**.
6465

66+
<!-- prettier-ignore -->
6567
> Valid uses:
6668
6769
- num_1
6870
- Num_1
6971
- nuM_1
7072
{: .prompt-tip }
7173

74+
<!-- prettier-ignore -->
7275
> Invalid uses:
7376
7477
- 1_num
@@ -80,8 +83,9 @@ The naming convention we've used here is recognised as 'snake case'. This is the
8083

8184
Another convention we _could_ use is called 'Camel Case', where we would capitalise the first character of each word and join them using underscores like `Camel_Case`.
8285

86+
<!-- prettier-ignore -->
8387
> **Note**: When it comes to creating variables, always keep in mind of the _built-in_ functions we have access to in Python as these also use 'reserved' words. It just means that using an existing functions name as a variable could cause errors throughout your program. Try be as unique as possible for all variable names.
84-
> {: .prompt-warning}
88+
{: .prompt-warning}
8589

8690
## Performing Functions
8791

@@ -168,8 +172,9 @@ print(is_light_on)
168172
- **Lists**
169173
- Lists are exactly as described, they are a list of data types that you can store. There are 4 collection types that you can have; Lists, Sets, Tuples, and Dictionaries. We'll be learning about lists, I believe on **Day 5**.
170174

175+
<!-- prettier-ignore -->
171176
> A concept called **List Comprehension** is explained in **Day 13** of the course I am using, which will further dissect the lists topic/module.
172-
> {: .prompt-tip}
177+
{: .prompt-tip}
173178

174179
## Using Different Data Types
175180

@@ -222,8 +227,9 @@ address = {
222227

223228
```
224229

230+
<!-- prettier-ignore -->
225231
> You can go on ahead and do the same on your own Python script and play around with some of the data types. Try making your own or use different data types for each!
226-
> {: .prompt-tip}
232+
{: .prompt-tip}
227233

228234
Let's now go on ahead and start using a function with these variables we have created. The function we will use is `type()` which brings back the data type of the information stored in that variable.
229235

@@ -264,8 +270,9 @@ Similar to primitive data types, Python has a large library of built-in function
264270

265271
By this point, I would say it's not imperative that we learn all the functions there are. However, it's a good idea to get a feel of what we have access to and what some of them do.
266272

273+
<!-- prettier-ignore -->
267274
> Visit 👉 [Python's Builtin Functions Documentation](https://docs.python.org/3.9/library/functions.html) to get a list of all the functions
268-
> {: .prompt-tip}
275+
{: .prompt-tip}
269276

270277
![Python built-in functions overview](012026/builtin-functions.png)
271278
_Image source: [30 Days Of Python: Day 2](https://github.com/Asabeneh/30-Days-Of-Python/blob/master/02_Day_Variables_builtin_functions/02_variables_builtin_functions.md)_

_posts/30DaysOfPython/2025-12-21-python-day3.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,9 @@ From that example, we are able to see how we can create conditions using IF Stat
185185

186186
While reviewing the course content and external sources, I came across operator types that weren’t heavily emphasised in the exercises. Even though they’re more niche, I wanted to include them here so my notes stay complete[^f2].
187187

188+
<!-- prettier-ignore -->
188189
> This is a complete guide to use or resource I would read over - [Python Identity Operators](https://www.w3schools.com/python/python_operators.asp)
189-
> {: .prompt-tip}
190+
{: .prompt-tip}
190191

191192
### Bitwise (Binary) Assignment Operators
192193

@@ -275,8 +276,9 @@ print(x is y) # False
275276
print(x == y) # True
276277
```
277278

279+
<!-- prettier-ignore -->
278280
> **Update**: I have recently learnt about **constant** and **runtime** sequences which explain that any sequential data, like strings, created _before_ runtime get stored in the same memory location for as long as the data inside are identical. Therefore, if you where to use the identity operator on these variables it would bring back a `True` statement.
279-
> {: .prompt-tip}
281+
{: .prompt-tip}
280282

281283
_Example:_
282284

_posts/30DaysOfPython/2025-12-21-python-day4.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ of code'''
5151

5252
Before I begin here, I would like to add that there are many built-in functions that Python has and I have discussed this in one of my earlier posts - _[Variables, Built-in Functions, and Data Types in Python](https://sheikh-h.github.io/Blog/posts/python-day2/)_.
5353

54+
<!-- prettier-ignore -->
5455
> Here is the official link from Python for built-in functions [Python Documentation - Built-In Functions](https://docs.python.org/3/library/functions.html)!
55-
> {: .prompt-tip}
56+
{: .prompt-tip}
5657

5758
```python
5859
var_a = "My name is Sheikh Hussain"
@@ -82,8 +83,9 @@ print(full_name)
8283

8384
Remember:
8485

86+
<!-- prettier-ignore -->
8587
> Using the `+` doesn't _add_ strings together, it creates a new string and presents that to you. The original variable stays the same.
86-
> {: .prompt-tip}
88+
{: .prompt-tip}
8789

8890
---
8991

@@ -125,8 +127,9 @@ There are several different types of escape functions that we can use and here i
125127
| `\uXXXX` | Unicode (16-bit) | `print("\u03A9")` | Ω |
126128
| `\UXXXXXXXX` | Unicode (32-bit) | `print("\U0001F600")` | 😀 |
127129

130+
<!-- prettier-ignore -->
128131
> This is a comprehensive list created with AI, I would say only 1/3 of them you'll want to really use. - It's just good to know.
129-
> {: .prompt-info}
132+
{: .prompt-info}
130133

131134
---
132135

@@ -249,8 +252,9 @@ print(word[-1]) # g
249252

250253
You can access items either using positive or negative numbers.
251254

255+
<!-- prettier-ignore -->
252256
> Positive numbers will start from `0` and work to the last item in the variable, negative numbers will start at `-1` then work towards the beginning of the variable.
253-
> {: .prompt-tip}
257+
{: .prompt-tip}
254258

255259
---
256260

@@ -282,8 +286,9 @@ Using this notation, you can select a portion of a sequence (like a string or li
282286

283287
- Step/Skip tells Python how many items to skip each time and select the index it lands on
284288

289+
<!-- prettier-ignore -->
285290
> **Tip**: If you leave start or stop empty, Python will automatically use the beginning or end of the sequence.
286-
> {: .prompt-tip}
291+
{: .prompt-tip}
287292

288293
---
289294

_posts/30DaysOfPython/2025-12-21-python-day5.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ Here is a small table with the different list types I have learnt so far:
4242
| Set | Unordered, un-indexed, and mutable | `items = {"Item1", 5, 12.33, False}` |
4343
| Dictionary | Ordered (Python 3.7+), key-value pairs | `items = {"name": "Item1", "count": 5}` |
4444

45+
<!-- prettier-ignore -->
4546
> **Note**: When we use the term _ordered_ for lists, we mean _preserving_ the order in which items were inserted - **not logical ordering**. Lists, Tuples, and Dictionaries **preserve** insertion order. In contrast, _Sets_ are unordered, hence if you were to create a set with items in, with each run of the program, you could see the items shift.
46-
> {: .prompt-tip}
47+
{: .prompt-tip}
4748

4849
## Creating lists
4950

@@ -99,8 +100,9 @@ new_lst = lst + ["Item8"]
99100
print(new_lst) # ["Item2", "Item1", "Item3", "Item4", "Item5", "Item6", "Item7", "Item8"]
100101
```
101102

103+
<!-- prettier-ignore -->
102104
> **List Concatenation** is an operation that produces a _new list_ by combining the items from other lists.
103-
> {: .prompt-tip}
105+
{: .prompt-tip}
104106

105107
We can also use advanced functions like `for loops` to add items into a list using a loop function, with each iteration of the loop an item from a list gets added.
106108

@@ -247,8 +249,9 @@ print("Cat" in lst) # True
247249
print("Lion" in lst) # False
248250
```
249251

252+
<!-- prettier-ignore -->
250253
> I want to recall a construct that I mentioned before while discussing operators, _constant and runtime sequences_[^f3]. Lists, though sequential, are mutable and therefore identical lists do not get stored in the same location.
251-
> {: .prompt-tip}
254+
{: .prompt-tip}
252255

253256
## Finding The Index Of An Item
254257

@@ -280,8 +283,9 @@ print(d) # ["Item4", "Item5"]
280283

281284
The `*variable =` assignment operator produces a new list with the _rest_ of the items in the list you specify.
282285

286+
<!-- prettier-ignore -->
283287
> **Hint**: With extended iterable unpacking, you can assign some items to individual variables and use a starred variable (\*variable) to collect the remaining items. You can place the starred variable at the start, middle, or end, but you can only have one starred variable.
284-
> {: .prompt-tip}
288+
{: .prompt-tip}
285289

286290
## Copying Lists
287291

@@ -342,8 +346,9 @@ lst.reverse()
342346
print(lst) # ["Item 3", "Item 1", "Item 2"]
343347
```
344348

345-
> Note how this just printed it all out in reverse rather than ordering.
346-
> {: .prompt-info}
349+
<!-- prettier-ignore -->
350+
> **Note**: how this just printed it all out in reverse rather than ordering.
351+
{: .prompt-info}
347352

348353
## Counting Items In a List
349354

0 commit comments

Comments
 (0)