Quick answers to common coding questions – HTML, Python, and AI.
<div> is a block‑level element – it takes up the full width of its container. <span> is an inline element – it only takes up as much width as needed.
Example:
<div>This is a block</div> <span>This is inline</span> <span>and this is next to it</span>
There are several ways to center a div:
margin: 0 auto; (requires a set width).display: flex; justify-content: center; align-items: center;display: grid; place-items: center;<section> groups related content – it's a thematic grouping. <article> is for self‑contained, independent content (like a blog post or news story).
<center> is deprecated – it no longer works in modern HTML. Use CSS instead: text-align: center; or Flexbox.
[ ].( ).Example:
fruits = ["apple", "banana"] # list – can add/remove
colors = ("red", "green") # tuple – cannot change
== – checks if values are equal.is – checks if they refer to the same object in memory.Example:
a = [1, 2, 3] b = [1, 2, 3] print(a == b) # True print(a is b) # False
Use the built‑in csv module:
import csv
with open("file.csv", "r") as f:
reader = csv.reader(f)
for row in reader:
print(row)
append() – adds one item to the end of the list.extend() – adds multiple items from an iterable.Example:
nums = [1, 2, 3] nums.append(4) # [1, 2, 3, 4] nums.extend([5, 6]) # [1, 2, 3, 4, 5, 6]
Gradient descent is an optimisation algorithm used to minimise the loss function in machine learning. It works by iteratively adjusting the model's parameters to reduce error.
An LLM is a type of AI trained on vast amounts of text to understand and generate human‑like language. Examples include GPT, Gemini, and Claude.
Start with AI concepts (what it is, applications), then dive into ML (supervised, unsupervised, reinforcement), and finally deep learning (neural networks).
Can't find what you're looking for? Suggest a question and I'll add it here.
📬 Suggest a Question