- Classicweekends
- Posts
- Snippet Test
Snippet Test
Code Snippet Exxamples
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Webpage</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>This is a simple HTML webpage.</p>
</body>
</html>
JS
// Simple JavaScript function to add two numbers
function addNumbers(a, b) {
return a + b;
}
// Example usage
console.log(addNumbers(5, 3)); // Output: 8
CSS
/* Simple CSS styling for a paragraph */
p {
color: blue;
font-size: 18px;
font-family: Arial, sans-serif;
}
PY
# Simple Python function to calculate the area of a rectangle
def calculate_area(length, width):
return length * width
# Example usage
print(calculate_area(5, 3)) # Output: 15
Plain Text
This is a simple plain text document.
It doesn't contain any markup or formatting.
Reply