Fundamentals of Digital Data and Web Technologies
File extensions are more than just a suffix; they tell both humans and software how to interpret the data inside a file. The most common plain‑text format for tabular data is the…

When reading a CSV file in Python, why must the full filename including its extension be specified in the code?
In the TCP/IP model, which protocol guarantees ordered delivery and integrity of data packets?
Which of the following best describes the role of a DNS server?
Given the JSON snippet {"Nom":"Hugo", "Prénom":"Victor"}, which statement about JSON structure is correct?
In a client‑server architecture, which component typically initiates the HTTP request?
Which of the following statements about the UTF‑8 encoding is accurate?
When comparing CSV, XML, and JSON formats, which characteristic is unique to JSON?
Which Python data type would you choose to store a mapping from a student's ID to their grade?
If a web page's HTML file omits the meta charset declaration, what is the most likely consequence?
Understanding File Extensions and Data Formats
File extensions are more than just a suffix; they tell both humans and software how to interpret the data inside a file. The most common plain‑text format for tabular data is the Comma‑Separated Values (CSV) file, which always uses the .csv extension. Unlike .html, .json, or .xml, a CSV file stores rows of data separated by commas (or another delimiter) without any markup language overhead.
- .csv – plain‑text, easy to read in spreadsheets.
- .json – lightweight data‑interchange format using key‑value pairs.
- .xml – hierarchical markup language with opening/closing tags.
- .html – markup for web pages, not a data‑exchange format.
Reading CSV Files in Python
When you write Python code to open a CSV file, you must provide the full filename, including its extension. This is because the operating system’s file system distinguishes files primarily by their names and extensions. The extension does not change the parser itself, but it ensures that Python (or any program) looks for the exact file you intend to read.
Example:
import csv
with open('data.csv', newline='') as f:
reader = csv.reader(f)
for row in reader:
print(row)
Omitting the extension (e.g., open('data')) would cause Python to raise a FileNotFoundError because the file data does not exist in the directory.
TCP/IP Model: Ensuring Reliable Data Transfer
Within the TCP/IP suite, the Transmission Control Protocol (TCP) is responsible for guaranteeing ordered delivery and data integrity. TCP establishes a connection, tracks packet sequence numbers, and retransmits lost packets. In contrast, the User Datagram Protocol (UDP) offers speed at the cost of reliability, and IP alone only handles routing without guaranteeing order.
- TCP – reliable, connection‑oriented, ensures ordered delivery.
- UDP – fast, connection‑less, no delivery guarantees.
- IP – routes packets, does not manage order or integrity.
Domain Name System (DNS) Basics
A DNS server acts as the phonebook of the internet. Its primary role is to translate human‑readable domain names (like www.example.com) into machine‑readable IP addresses. This translation enables browsers to locate the correct server without the user needing to remember numeric addresses.
Key points about DNS:
- It does not host website files; that is the job of a web server.
- It does not route packets; routers perform that function.
- It does not encrypt traffic; TLS/SSL handles encryption.
JSON Structure Explained
JavaScript Object Notation (JSON) is a lightweight data‑interchange format that represents information as key‑value pairs inside curly braces. Each key is a string, followed by a colon and its associated value. Commas separate multiple pairs, and the entire structure is enclosed in { }.
Example snippet:
{
"Nom": "Hugo",
"Prénom": "Victor"
}
This illustrates that JSON data are always expressed as pairs of keys and values, not as XML‑style tags or semicolon‑separated items.
Client‑Server Interaction and HTTP Requests
In a typical web architecture, the client—usually a web browser—initiates communication by sending an HTTP request to a server. The server then processes the request and returns a response (HTML, JSON, images, etc.). The DNS resolver, router, and server each play supporting roles, but the request originates from the client side.
- Client (browser) – sends HTTP requests.
- DNS resolver – translates domain names before the request is sent.
- Router – forwards packets across networks.
- Server – receives the request and returns the response.
UTF‑8 Encoding: Universal Character Support
UTF‑8 is the dominant character encoding for the web because it can represent any Unicode character. It uses a variable‑length byte sequence (1 to 4 bytes) to encode characters, making it backward‑compatible with ASCII while supporting global scripts.
Common misconceptions:
- UTF‑8 is not limited to Latin‑1; it covers the entire Unicode range.
- It works perfectly with HTML meta tags, e.g.,
<meta charset="UTF-8">. - It does not use exactly one byte per character; multi‑byte sequences are used for non‑ASCII characters.
Comparing CSV, XML, and JSON Formats
While CSV, XML, and JSON all serve to exchange data, each has distinct characteristics. One feature that is unique to JSON is that it stores data as unordered key‑value pairs (objects). CSV is purely tabular, XML relies on nested tags, and JSON’s object notation provides a flexible, lightweight way to represent hierarchical data without the verbosity of XML.
- CSV – rows separated by line breaks, fields separated by commas; best for simple tables.
- XML – hierarchical, uses opening and closing tags; verbose but highly extensible.
- JSON – unordered key‑value pairs (objects) and ordered arrays; concise and easy for JavaScript parsing.
Putting It All Together: A Mini‑Project Overview
To reinforce these concepts, consider building a small Python project that reads a .csv file, converts its rows into a JSON object, and serves the result via a simple HTTP server. This exercise will touch on:
- File handling with correct extensions.
- Parsing CSV data using the
csvmodule. - Creating JSON structures with
json.dumps(). - Serving data over HTTP, where the client (browser) initiates the request.
- Ensuring the server sends the correct
Content‑Type: application/json; charset=UTF-8header.
By completing this mini‑project, you will have hands‑on experience with file extensions, data formats, network protocols, and encoding—all essential foundations for modern web development.
