<!
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Basic Programming Concepts in Python</title>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
margin: 20px;
max-width: 800px;
margin: 0 auto;
padding: 20px;
background-color: #f9f9f9;
color: #333;
}
h1 {
text-align: center;
color: #2c3e50;
border-bottom: 2px solid #eee;
padding-bottom: 10px;
}
h2 {
color: #2980b9;
margin-top: 30px;
border-bottom: 1px solid #ddd;
padding-bottom: 5px;
}
ul {
list-style-type: disc;
padding-left: 20px;
}
li {
margin-bottom: 10px;
}
code {
background-color: #f4f4f4;
padding: 2px 4px;
border-radius: 4px;
font-family: monospace;
}
pre {
background-color: #f4f4f4;
padding: 10px;
border-radius: 4px;
overflow-x: auto;
font-family: monospace;
margin: 10px 0;
}
.info {
font-style: italic;
text-align: center;
margin-bottom: 20px;
}
</style>
</head>
<body>
<header>
<h1>Basic Programming Concepts in Python</h1>
<p class="info">Date: October 21, 2025</p>
<p class="info">Course: Introduction to Programming</p>
<p class="info">Instructor: Prof. Maria Gonzalez</p>
</header>
<main>
<section>
<h2>Variables and Data Types</h2>
<p>Variables store data. Examples:</p>
<ul>
<li><code>x = 5</code> (integer)</li>
<li><code>name = "Alice"</code> (string)</li>
<li><code>is_student = True</code> (boolean)</li>
</ul>
<p>Use <code>type()</code> to check data type.</p>
</section>
<section>
<h2>Control Structures</h2>
<ul>
<li>If-else: <code>if condition: code</code> for decisions.</li>
<li>Loops: For loop <code>for i in range(10): print(i)</code>;
While loop for repeated actions until false.</li>
</ul>
</section>
<section>
<h2>Functions</h2>
<p>Define with <code>def function_name(params):</code>. Example:</p>
<pre><code>def add(a, b):
return a + b
result = add(3, 4) # Outputs 7</code></pre>
</section>
<section>
<h2>Lists and Dictionaries</h2>
<ul>
<li>Lists: <code>fruits = ["apple", "banana"]</code>; access via
index <code>fruits[0]</code>.</li>
<li>Dictionaries: <code>person = {"name": "Bob", "age": 30}</code>;
access <code>person["name"]</code>.</li>
</ul>
</section>
<section>
<h2>Error Handling</h2>
<p>Use try-except:</p>
<pre><code>try:
num = int(input("Enter number: "))
except ValueError:
print("Invalid input")</code></pre>
</section>
<section>
<h2>Homework</h2>
<p>Write a program to calculate factorial using recursion. Review
chapters 1-3 in textbook.</p>
</section>
</main>
</body>
</html>