-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtutorial.php
More file actions
1943 lines (1832 loc) · 101 KB
/
tutorial.php
File metadata and controls
1943 lines (1832 loc) · 101 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
// Include visitor tracking
require_once 'includes/track_visitor.php';
/**
* ==========================================================
* File: tutorial.php
*
* Description:
* - Tutorial page for Code Gaming platform
* - Features:
* • Sidebar navigation for tutorial categories
* • Main content area for tutorial display
* • Interactive code examples
* • Progress tracking
* • Responsive design for all devices
*
* Dependencies:
* - includes/Database.php: For fetching programming languages and topics.
* - includes/Auth.php: For user authentication status and personalized content.
* - includes/header.php: Centralized header for consistent navigation and styling.
* - includes/footer.php: Centralized footer for consistent layout.
*
* @author [Santiago]
* @version 1.0.0
* @last_updated 2025-07-22
*/
// Include required files
require_once 'includes/Database.php';
require_once 'includes/Auth.php';
// Initialize core components
$db = Database::getInstance();
$auth = Auth::getInstance();
// Get programming languages
$languages = $db->getProgrammingLanguages();
// Define topics for each language directly in PHP
$topicsConfig = [
'html' => [
['id' => 'html-1', 'title' => 'Topic #1: HTML Fundamentals', 'description' => 'Learn the basic structure and elements of HTML documents.', 'difficulty' => 'beginner',
'content' => '
<h3>What is HTML?</h3>
<p>HTML (HyperText Markup Language) is the backbone of every web page. It provides the basic structure using elements (tags) that browsers understand and render visually.</p>
<h4>Basic HTML Structure</h4>
<pre><code><!DOCTYPE html>
<html>
<head>
<title>My First Page</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>Welcome to HTML fundamentals.</p>
</body>
</html></code></pre>
<ul>
<li><strong><html></strong>: Root element of the page.</li>
<li><strong><head></strong>: Metadata (title, links to CSS, etc.).</li>
<li><strong><body></strong>: Main content visible on the page.</li>
</ul>
'],
['id' => 'html-2', 'title' => 'Topic #2: HTML Elements & Attributes', 'description' => 'Explore common HTML elements and their attributes.', 'difficulty' => 'beginner',
'content' => '
<h3>HTML Elements</h3>
<p>Elements are the building blocks of HTML, defined by tags such as <code><h1></code>, <code><p></code>, <code><div></code>, etc.</p>
<pre><code><h1>This is a heading</h1>
<p>This is a paragraph.</p>
</code></pre>
<h3>Attributes</h3>
<p>Attributes provide extra information about elements. They go inside the opening tag.</p>
<pre><code><a href="https://example.com">Visit Example</a></code></pre>
<ul>
<li><strong>href</strong>: Specifies the URL for a link.</li>
<li><strong>src</strong>: Specifies the image source for <code><img></code> tags.</li>
</ul>
'],
['id' => 'html-3', 'title' => 'Topic #3: Links & Images', 'description' => 'How to add links and images to your web pages.', 'difficulty' => 'beginner',
'content' => '
<h3>Hyperlinks</h3>
<p>Use <code><a></code> to create hyperlinks to other pages or sites.</p>
<pre><code><a href="https://www.google.com">Go to Google</a></code></pre>
<h3>Images</h3>
<p>Use <code><img></code> to display images.</p>
<pre><code><img src="logo.png" alt="Website Logo"></code></pre>
<ul>
<li><strong>src</strong>: Path to the image file.</li>
<li><strong>alt</strong>: Alternative text for accessibility.</li>
</ul>
'],
['id' => 'html-4', 'title' => 'Topic #4: Lists & Tables', 'description' => 'Create lists and tables for structured content.', 'difficulty' => 'beginner',
'content' => '
<h3>Lists</h3>
<p>There are two basic types: ordered (<code><ol></code>) and unordered (<code><ul></code>).</p>
<pre><code>
<ul>
<li>Apple</li>
<li>Banana</li>
</ul>
<ol>
<li>First</li>
<li>Second</li>
</ol>
</code></pre>
<h3>Tables</h3>
<p>Tables organize data into rows and columns.</p>
<pre><code>
<table>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>Alice</td>
<td>21</td>
</tr>
</table>
</code></pre>
'],
['id' => 'html-5', 'title' => 'Topic #5: Forms & Input', 'description' => 'Master HTML forms and input types.', 'difficulty' => 'intermediate',
'content' => '
<h3>HTML Forms</h3>
<p>Forms collect user input and send it to a server. Basic form elements include <code><input></code>, <code><textarea></code>, <code><button></code>, and <code><select></code>.</p>
<pre><code>
<form>
<label>Name:</label>
<input type="text" name="username">
<input type="submit" value="Submit">
</form>
</code></pre>
<ul>
<li><strong>type</strong>: Specifies the input type (text, password, email, etc.).</li>
<li><strong>name</strong>: The name for the data submitted.</li>
</ul>
'],
['id' => 'html-6', 'title' => 'Topic #6: Semantic HTML', 'description' => 'Use semantic tags for better accessibility and SEO.', 'difficulty' => 'intermediate',
'content' => '
<h3>Semantic Elements</h3>
<p>Semantic tags clearly describe their meaning and structure (for both browsers and developers).</p>
<ul>
<li><code><header></code>, <code><nav></code>, <code><main></code>, <code><section></code>, <code><article></code>, <code><footer></code></li>
</ul>
<p>Example:</p>
<pre><code>
<header>Site Header</header>
<nav>Main Navigation</nav>
<main>
<article>Blog Post</article>
</main>
<footer>Site Footer</footer>
</code></pre>
'],
['id' => 'html-7', 'title' => 'Topic #7: Media Elements', 'description' => 'Embed audio, video, and other media.', 'difficulty' => 'intermediate',
'content' => '
<h3>Embedding Media</h3>
<p>HTML lets you add audio, video, and other multimedia to your website.</p>
<h4>Audio</h4>
<pre><code>
<audio controls>
<source src="audio.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
</code></pre>
<h4>Video</h4>
<pre><code>
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</code></pre>
'],
['id' => 'html-8', 'title' => 'Topic #8: HTML APIs', 'description' => 'Introduction to HTML5 APIs.', 'difficulty' => 'expert',
'content' => '
<h3>HTML5 APIs</h3>
<p>HTML5 introduced powerful APIs for modern web applications:</p>
<ul>
<li><strong>Canvas API</strong>: Draw graphics using JavaScript.</li>
<li><strong>Geolocation API</strong>: Get user location.</li>
<li><strong>Local Storage</strong>: Store data in the browser.</li>
</ul>
<p>Example: Using Local Storage</p>
<pre><code>
<script>
localStorage.setItem("username", "Alice");
const name = localStorage.getItem("username");
</script>
</code></pre>
'],
['id' => 'html-9', 'title' => 'Topic #9: Accessibility', 'description' => 'Make your web pages accessible to all users.', 'difficulty' => 'expert',
'content' => '
<h3>Accessible HTML</h3>
<p>Accessibility ensures your site works for everyone, including users with disabilities.</p>
<ul>
<li>Use <strong>alt</strong> text for images.</li>
<li>Ensure proper heading structure (<code><h1> - <h6></code>).</li>
<li>Use semantic tags.</li>
<li>Add <code>aria</code> attributes where necessary.</li>
</ul>
<p>Example:</p>
<pre><code>
<img src="logo.png" alt="Company Logo">
<button aria-label="Close">X</button>
</code></pre>
'],
['id' => 'html-10', 'title' => 'Topic #10: Best Practices', 'description' => 'Tips and tricks for writing clean HTML.', 'difficulty' => 'expert',
'content' => '
<h3>HTML Best Practices</h3>
<ul>
<li>Use semantic elements for clarity and SEO.</li>
<li>Always include <code>alt</code> attributes for images.</li>
<li>Keep your code clean and well-indented.</li>
<li>Validate your HTML using tools like <a href="https://validator.w3.org/" target="_blank">W3C Validator</a>.</li>
<li>Test your pages on multiple browsers and devices.</li>
</ul>
'],
],
'css' => [
['id' => 'css-1', 'title' => 'Topic #1: CSS Basics', 'description' => 'Introduction to CSS syntax and selectors.', 'difficulty' => 'beginner',
'content' => '
<h3>What is CSS?</h3>
<p>CSS (Cascading Style Sheets) is used to style and layout web pages. It controls colors, fonts, spacing, and positioning of HTML elements.</p>
<h4>Basic Syntax</h4>
<pre><code>
selector {
property: value;
}
</code></pre>
<p>Example:</p>
<pre><code>
p {
color: blue;
font-size: 16px;
}
</code></pre>
<ul>
<li><strong>Selectors</strong> target HTML elements.</li>
<li><strong>Properties</strong> define what to change.</li>
<li><strong>Values</strong> set the property’s value.</li>
</ul>
'],
['id' => 'css-2', 'title' => 'Topic #2: Colors & Backgrounds', 'description' => 'Styling backgrounds and using color.', 'difficulty' => 'beginner',
'content' => '
<h3>Colors</h3>
<p>Set colors using names, HEX, RGB, or HSL.</p>
<pre><code>
body {
background-color: #f0f0f0;
color: rgb(40, 40, 40);
}
</code></pre>
<h3>Backgrounds</h3>
<p>Control backgrounds with <code>background</code> properties.</p>
<pre><code>
div {
background-image: url("image.jpg");
background-repeat: no-repeat;
background-size: cover;
}
</code></pre>
<ul>
<li><strong>background-color</strong>: Sets background color.</li>
<li><strong>background-image</strong>: Adds images behind content.</li>
</ul>
'],
['id' => 'css-3', 'title' => 'Topic #3: Text & Fonts', 'description' => 'Control typography and font styles.', 'difficulty' => 'beginner',
'content' => '
<h3>Text Styling</h3>
<p>Change font, size, weight, and style with CSS.</p>
<pre><code>
h1 {
font-family: "Arial", sans-serif;
font-size: 2em;
font-weight: bold;
color: #333;
}
</code></pre>
<h3>Font Properties</h3>
<ul>
<li><strong>font-family</strong>: Sets the typeface.</li>
<li><strong>font-size</strong>: Adjusts text size.</li>
<li><strong>font-weight</strong>: Bold, normal, etc.</li>
<li><strong>color</strong>: Sets text color.</li>
</ul>
'],
['id' => 'css-4', 'title' => 'Topic #4: Box Model', 'description' => 'Understand margin, border, padding, and content.', 'difficulty' => 'beginner',
'content' => '
<h3>The CSS Box Model</h3>
<p>Every HTML element is a box with four parts:</p>
<ul>
<li><strong>Content</strong>: The actual text or image.</li>
<li><strong>Padding</strong>: Space inside the border.</li>
<li><strong>Border</strong>: The line around the box.</li>
<li><strong>Margin</strong>: Space outside the border.</li>
</ul>
<pre><code>
div {
margin: 20px;
padding: 10px;
border: 2px solid #888;
}
</code></pre>
<p>Understanding the box model helps with layout and spacing.</p>
'],
['id' => 'css-5', 'title' => 'Topic #5: Flexbox', 'description' => 'Modern layout with CSS Flexbox.', 'difficulty' => 'intermediate',
'content' => '
<h3>CSS Flexbox</h3>
<p>Flexbox is a modern layout tool for arranging items in rows or columns.</p>
<pre><code>
.container {
display: flex;
justify-content: center;
align-items: center;
}
</code></pre>
<ul>
<li><strong>display: flex</strong>: Enables flexbox.</li>
<li><strong>justify-content</strong>: Controls horizontal alignment.</li>
<li><strong>align-items</strong>: Controls vertical alignment.</li>
</ul>
<p>Flexbox makes it easy to build responsive layouts!</p>
'],
['id' => 'css-6', 'title' => 'Topic #6: Grid Layout', 'description' => 'Advanced layouts with CSS Grid.', 'difficulty' => 'intermediate',
'content' => '
<h3>CSS Grid Layout</h3>
<p>Grid is the most powerful CSS layout system for structuring content in rows and columns.</p>
<pre><code>
.grid-container {
display: grid;
grid-template-columns: 1fr 2fr 1fr;
gap: 10px;
}
</code></pre>
<ul>
<li><strong>display: grid</strong>: Enables grid layout.</li>
<li><strong>grid-template-columns</strong>: Defines columns.</li>
<li><strong>gap</strong>: Sets spacing between items.</li>
</ul>
'],
['id' => 'css-7', 'title' => 'Topic #7: Transitions & Animations', 'description' => 'Add motion to your web pages.', 'difficulty' => 'intermediate',
'content' => '
<h3>CSS Transitions</h3>
<p>Transitions create smooth changes between property values.</p>
<pre><code>
button {
background: #007bff;
transition: background 0.3s;
}
button:hover {
background: #0056b3;
}
</code></pre>
<h3>CSS Animations</h3>
<p>Animations let you animate multiple properties.</p>
<pre><code>
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
div {
animation: fadeIn 1s ease-in;
}
</code></pre>
'],
['id' => 'css-8', 'title' => 'Topic #8: Responsive Design', 'description' => 'Make your site look great on any device.', 'difficulty' => 'expert',
'content' => '
<h3>Responsive Design</h3>
<p>Make your site look good on all devices using media queries.</p>
<pre><code>
@media (max-width: 600px) {
body {
font-size: 14px;
}
.menu {
flex-direction: column;
}
}
</code></pre>
<ul>
<li><strong>Media queries</strong> adapt styles for different screen sizes.</li>
<li>Use relative units (%, em, rem) for flexible layouts.</li>
</ul>
'],
['id' => 'css-9', 'title' => 'Topic #9: CSS Variables', 'description' => 'Reusable values with custom properties.', 'difficulty' => 'expert',
'content' => '
<h3>CSS Variables (Custom Properties)</h3>
<p>Variables help you reuse values and make your styles easier to update.</p>
<pre><code>
:root {
--main-color: #ff6600;
}
h1 {
color: var(--main-color);
}
</code></pre>
<ul>
<li>Define variables inside <code>:root</code> for global scope.</li>
<li>Use <code>var(--variable-name)</code> to apply them.</li>
</ul>
'],
['id' => 'css-10', 'title' => 'Topic #10: CSS Best Practices', 'description' => 'Write maintainable and scalable CSS.', 'difficulty' => 'expert',
'content' => '
<h3>CSS Best Practices</h3>
<ul>
<li>Keep your CSS organized and well-commented.</li>
<li>Use classes for styling instead of element selectors.</li>
<li>Use CSS variables for consistent colors and spacing.</li>
<li>Test your styles on different browsers and devices.</li>
<li>Minimize repetition by grouping shared styles.</li>
</ul>
'],
],
'bootstrap' => [
['id' => 'bootstrap-1', 'title' => 'Topic #1: Bootstrap Introduction', 'description' => 'What is Bootstrap and why use it?', 'difficulty' => 'beginner',
'content' => '
<div style="display: flex; align-items: center; gap: 12px; margin-bottom: 8px;">
<i class="bx bxl-bootstrap" style="font-size: 2.2rem; color: #7952b3;"></i>
<span style="font-size: 1.3rem; font-weight: 600; color: #7952b3;">Bootstrap</span>
</div>
<p><strong>Bootstrap</strong> is a popular open-source CSS framework for developing responsive and mobile-first websites. It provides ready-to-use components, a grid system, and powerful utilities to speed up web development.</p>
<p>Bootstrap was originally created by <strong>Mark Otto</strong> and <strong>Jacob Thornton</strong> at Twitter in mid-2010, and released as an open-source project in August 2011. Its goal was to unify and simplify the front-end development process at Twitter, but it quickly became the world’s most popular front-end toolkit.</p>
<div style="display: flex; gap: 18px; align-items: flex-start; margin: 1.2rem 0;">
<img src="https://getbootstrap.com/docs/5.3/assets/brand/bootstrap-logo-shadow.png" alt="Bootstrap Logo" style="width: 80px; height: 80px; object-fit: contain; border-radius: 12px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.07);">
<div>
<p>Today, Bootstrap is used by millions of websites and is maintained by a large community of developers. It supports all modern browsers and is constantly updated with new features and improvements.</p>
</div>
</div>
<ul>
<li><i class="bx bx-check-circle" style="color: #28a745;"></i> <strong>Easy to use:</strong> Start with just a single CSS file.</li>
<li><i class="bx bx-mobile-alt" style="color: #00bfff;"></i> <strong>Responsive by default:</strong> Adapts to any device size.</li>
<li><i class="bx bx-cog" style="color: #ffc107;"></i> <strong>Customizable:</strong> Use Sass variables and mixins to make it your own.</li>
<li><i class="bx bx-layer" style="color: #7952b3;"></i> <strong>Component-rich:</strong> Includes navbars, modals, carousels, and more.</li>
</ul>
<h5 style="margin-top: 1.5rem; color: #00bfff;"><i class="bx bx-star"></i> Fun Facts</h5>
<ul>
<li>Bootstrap was originally named "Twitter Blueprint".</li>
<li>It’s one of the most starred projects on GitHub.</li>
<li>Major sites like NASA, Spotify, and Vogue have used Bootstrap.</li>
<li>Bootstrap 5 dropped jQuery for a more modern, vanilla JS approach.</li>
</ul>
<p style="margin-top: 1.5rem;">Learn more at <a href="https://getbootstrap.com/" target="_blank">getbootstrap.com</a>.</p>'
],
['id' => 'bootstrap-2', 'title' => 'Topic #2: Bootstrap Grid', 'description' => 'Responsive layouts with the grid system.', 'difficulty' => 'beginner',
'content' => '
<div style="display: flex; align-items: center; gap: 12px; margin-bottom: 8px;">
<i class="bx bxl-bootstrap" style="font-size: 2.2rem; color: #7952b3;"></i>
<span style="font-size: 1.3rem; font-weight: 600; color: #7952b3;">Bootstrap</span>
</div>
<p><strong>Bootstrap Grid</strong> is a responsive, mobile-first grid system that allows you to create complex layouts with ease. It provides a flexible and intuitive way to structure your content, ensuring it looks great on any device.</p>
<p>The grid system is based on a 12-column layout, which means you can create layouts with up to 12 columns. You can use the grid to create responsive layouts that adapt to different screen sizes, from small mobile devices to large desktop screens.</p>
<p>The grid system is built with flexbox, which means it provides a more efficient and flexible way to create layouts. It also provides a set of utility classes that you can use to quickly style your content, such as padding and margin classes.</p>
<p>The grid system is a powerful tool that can help you create responsive and mobile-first websites. It is a great way to ensure that your content looks great on any device, and it is a great way to create complex layouts with ease.</p>
<p>Learn more at <a href="https://getbootstrap.com/docs/5.3/layout/grid/" target="_blank">getbootstrap.com/docs/5.3/layout/grid/</a>.</p>'
],
['id' => 'bootstrap-3', 'title' => 'Topic #3: Bootstrap Components', 'description' => 'Buttons, cards, navbars, and more.', 'difficulty' => 'beginner',
'content' => '
<div style="display: flex; align-items: center; gap: 12px; margin-bottom: 8px;">
<i class="bx bxl-bootstrap" style="font-size: 2.2rem; color: #7952b3;"></i>
<span style="font-size: 1.3rem; font-weight: 600; color: #7952b3;">Bootstrap</span>
</div>
<h2>Understanding Bootstrap Components</h2>
<p><strong>Bootstrap Components</strong> are pre-built, reusable UI elements that simplify web development. They include buttons, cards, navbars, forms, alerts, modals, and more. These components are designed to be responsive and work seamlessly across different devices, making it easier to create modern, mobile-first websites.</p>
<p>In this tutorial, we\'ll explore some of the most commonly used Bootstrap Components and learn how to implement them in your projects. To use these components, include Bootstrap 5’s CSS and JavaScript in your HTML file:</p>
<pre><code><link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script></code></pre>
<h3>Buttons</h3>
<p>Bootstrap provides a variety of button styles and sizes to suit different needs. You can create buttons with different colors, sizes, and states (like active or disabled).</p>
<p>Here\'s an example of basic buttons:</p>
<pre><code><button type="button" class="btn btn-primary">Primary</button>
<button type="button" class="btn btn-secondary">Secondary</button>
<button type="button" class="btn btn-success">Success</button>
<button type="button" class="btn btn-danger">Danger</button>
<button type="button" class="btn btn-warning">Warning</button>
<button type="button" class="btn btn-info">Info</button>
<button type="button" class="btn btn-light">Light</button>
<button type="button" class="btn btn-dark">Dark</button></code></pre>
<p>You can also create outline buttons, which have a border but no background color, or adjust sizes with <code>btn-lg</code> or <code>btn-sm</code>:</p>
<pre><code><button type="button" class="btn btn-outline-primary">Outline Primary</button>
<button type="button" class="btn btn-primary btn-lg">Large Button</button>
<button type="button" class="btn btn-primary btn-sm">Small Button</button></code></pre>
<h3>Cards</h3>
<p>Cards are versatile components that can hold text, images, buttons, and more. They are ideal for displaying content like blog posts or product details.</p>
<p>Here\'s a basic card example:</p>
<pre><code><div class="card" style="width: 18rem;">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card Title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card\'s content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div></code></pre>
<p>You can add headers or lists for more complex cards:</p>
<pre><code><div class="card" style="width: 18rem;">
<div class="card-header">Featured</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">Item 1</li>
<li class="list-group-item">Item 2</li>
<li class="list-group-item">Item 3</li>
</ul>
<div class="card-body">
<h5 class="card-title">Special Title</h5>
<p class="card-text">Additional content here.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div></code></pre>
<h3>Navbars</h3>
<p>Navbars are navigation headers that include links, forms, and dropdowns, typically used at the top of a webpage.</p>
<p>Here\'s a responsive navbar example:</p>
<pre><code><nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown
</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
<form class="d-flex">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
</div>
</div>
</nav></code></pre>
<p>This navbar collapses on small screens and includes a toggler for mobile navigation.</p>
<h3>Forms</h3>
<p>Bootstrap provides classes to style form elements like inputs, labels, and buttons, making forms user-friendly.</p>
<p>Here\'s a basic form example:</p>
<pre><code><form>
<div class="mb-3">
<label for="exampleInputEmail1" class="form-label">Email address</label>
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp">
<div id="emailHelp" class="form-text">We\'ll never share your email with anyone else.</div>
</div>
<div class="mb-3">
<label for="exampleInputPassword1" class="form-label">Password</label>
<input type="password" class="form-control" id="exampleInputPassword1">
</div>
<div class="mb-3 form-check">
<input type="checkbox" class="form-check-input" id="exampleCheck1">
<label class="form-check-label" for="exampleCheck1">Check me out</label>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form></code></pre>
<p>Use classes like <code>form-control</code> for inputs and <code>form-check</code> for checkboxes.</p>
<h3>Alerts</h3>
<p>Alerts provide feedback messages for user actions, such as success or error notifications.</p>
<p>Here\'s an example of different alert types:</p>
<pre><code><div class="alert alert-primary" role="alert">
A simple primary alert—check it out!
</div>
<div class="alert alert-success" role="alert">
A simple success alert—check it out!
</div>
<div class="alert alert-danger" role="alert">
A simple danger alert—check it out!
</div>
<div class="alert alert-warning" role="alert">
A simple warning alert—check it out!
</div></code></pre>
<p>For dismissible alerts, add a close button:</p>
<pre><code><div class="alert alert-warning alert-dismissible fade show" role="alert">
<strong>Holy guacamole!</strong> You should check in on some of those fields below.
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div></code></pre>
<h3>Modals</h3>
<p>Modals are dialog boxes for displaying content or forms, triggered by buttons or other elements.</p>
<p>Here\'s a modal example:</p>
<pre><code><button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal">
Launch demo modal
</button>
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>Modal body text goes here.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div></code></pre>
<p>Ensure Bootstrap’s JavaScript is included for modals to function.</p>
<h3>Conclusion</h3>
<p>Bootstrap Components make it easy to create responsive, professional-looking websites. By mastering buttons, cards, navbars, forms, alerts, and modals, you can build engaging user interfaces. Explore more components and advanced features in the official documentation:</p>
<ul>
<li><a href="https://getbootstrap.com/docs/5.3/components/" target="_blank">Bootstrap 5 Components</a></li>
<li><a href="https://www.w3schools.com/bootstrap5/" target="_blank">W3Schools Bootstrap 5 Tutorial</a></li>
</ul>'
],
['id' => 'bootstrap-4', 'title' => 'Topic 4: Utilities & Helpers', 'description' => 'Quickly style elements with utility classes.', 'difficulty' => 'beginner',
'content' => '
<h3>Bootstrap Utilities & Helpers</h3>
<p>Bootstrap comes with hundreds of utility classes that help you style elements quickly without writing custom CSS.</p>
<ul>
<li><strong>Spacing:</strong> <code>.m-2</code> (margin), <code>.p-3</code> (padding)</li>
<li><strong>Text:</strong> <code>.text-center</code>, <code>.text-danger</code></li>
<li><strong>Display:</strong> <code>.d-flex</code>, <code>.d-none</code></li>
<li><strong>Colors:</strong> <code>.bg-primary</code>, <code>.text-success</code></li>
<li><strong>Borders:</strong> <code>.border</code>, <code>.rounded</code></li>
</ul>
<pre><code>
<div class="bg-warning p-3 text-center rounded">
Quick styled box!
</div>
</code></pre>
<p>For a full list of utilities, see <a href="https://getbootstrap.com/docs/5.3/utilities/" target="_blank">Bootstrap Utilities</a>.</p>
'],
['id' => 'bootstrap-5', 'title' => 'Topic 5: Customizing Bootstrap', 'description' => 'Override and extend Bootstrap styles.', 'difficulty' => 'intermediate',
'content' => '
<h3>Customizing Bootstrap</h3>
<p>Override Bootstrap’s default styles to match your brand or design needs.</p>
<ul>
<li><strong>Use your own CSS:</strong> Write custom styles after the Bootstrap CSS link.</li>
<li><strong>Customize Sass variables:</strong> Change colors, fonts, and breakpoints by editing Bootstrap’s source Sass files.</li>
</ul>
<pre><code>
/* Example: Override primary color */
:root {
--bs-primary: #ff6600;
}
</code></pre>
<p>Learn more about customization at <a href="https://getbootstrap.com/docs/5.3/customize/" target="_blank">Bootstrap Customize</a>.</p>
'],
['id' => 'bootstrap-6', 'title' => 'Topic 6: Bootstrap JS Plugins', 'description' => 'Add interactivity with Bootstrap plugins.', 'difficulty' => 'intermediate',
'content' => '<h3>Bootstrap JavaScript Plugins</h3>
<p>Bootstrap includes interactive plugins powered by JavaScript, such as dropdowns, modals, and tooltips.</p>
<ul>
<li><strong>Modals</strong>: Pop-up windows for dialogs.</li>
<li><strong>Tooltips</strong>: Small pop-up info boxes.</li>
<li><strong>Dropdowns</strong>: Menus for navigation or actions.</li>
<li><strong>Collapse</strong>: Hide/show content panels.</li>
</ul>
<p>To use plugins, add Bootstrap’s JS bundle:</p>
<pre><code>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
</code></pre>
<p>Example: Trigger a tooltip</p>
<pre><code>
<button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" title="Tooltip text">
Hover me
</button>
</code></pre>'],
['id' => 'bootstrap-7', 'title' => 'Topic 7: Forms & Validation', 'description' => 'Build and validate forms with Bootstrap.', 'difficulty' => 'intermediate',
'content' => '<h3>Bootstrap Forms & Validation</h3>
<p>Build beautiful forms and validate inputs easily with Bootstrap classes.</p>
<ul>
<li><strong>Form controls:</strong> <code>.form-control</code> for inputs, <code>.form-check</code> for checkboxes.</li>
<li><strong>Layout:</strong> Use <code>.row</code> and <code>.col</code> for grid forms.</li>
<li><strong>Validation:</strong> Add <code>.is-valid</code> or <code>.is-invalid</code> classes for feedback.</li>
</ul>
<pre><code>
<form>
<input type="text" class="form-control is-valid" placeholder="Valid input">
<input type="text" class="form-control is-invalid" placeholder="Invalid input">
<div class="valid-feedback">Looks good!</div>
<div class="invalid-feedback">Please enter a valid value.</div>
</form>
</code></pre>
<p>Read more at <a href="https://getbootstrap.com/docs/5.3/forms/validation/" target="_blank">Bootstrap Form Validation</a>.</p>'],
['id' => 'bootstrap-8', 'title' => 'Topic 8: Advanced Components', 'description' => 'Carousels, modals, and more.', 'difficulty' => 'expert',
'content' => '<h3>Bootstrap Advanced Components</h3>
<p>Go beyond basics with advanced UI components:</p>
<ul>
<li><strong>Carousel</strong>: Create image or content sliders.</li>
<li><strong>Accordion</strong>: Expand/collapse sections for FAQs or content.</li>
<li><strong>Toast</strong>: Show notifications in small pop-up boxes.</li>
</ul>
<pre><code>
<div id="carouselExample" class="carousel slide">
<div class="carousel-inner">
<div class="carousel-item active">
<img src="img1.jpg" class="d-block w-100" alt="...">
</div>
<div class="carousel-item">
<img src="img2.jpg" class="d-block w-100" alt="...">
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExample" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#carouselExample" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
</code></pre>
<p>See all advanced components at <a href="https://getbootstrap.com/docs/5.3/components/" target="_blank">Bootstrap Components</a>.</p>'],
['id' => 'bootstrap-9', 'title' => 'Topic 9: Accessibility in Bootstrap', 'description' => 'Make Bootstrap sites accessible.', 'difficulty' => 'expert',
'content' => '<h3>Accessibility in Bootstrap</h3>
<p>Bootstrap helps make sites accessible by default, but you can improve further:</p>
<ul>
<li>Use semantic HTML and Bootstrap’s accessible components.</li>
<li>Add <code>aria-*</code> attributes for screen readers (e.g., <code>aria-label</code>, <code>aria-expanded</code>).</li>
<li>Ensure colors and contrasts meet accessibility standards.</li>
</ul>
<p>Example:</p>
<pre><code>
<button class="btn btn-primary" aria-label="Close">X</button>
</code></pre>
<p>Learn more at <a href="https://getbootstrap.com/docs/5.3/accessibility/" target="_blank">Bootstrap Accessibility</a>.</p>'],
['id' => 'bootstrap-10', 'title' => 'Topic 10: Bootstrap Best Practices', 'description' => 'Tips for scalable Bootstrap projects.', 'difficulty' => 'expert',
'content' => '<h3>Bootstrap Best Practices</h3>
<ul>
<li>Use utility classes for quick styling and less custom CSS.</li>
<li>Keep your markup clean and organized.</li>
<li>Customize variables or use your own CSS for brand consistency.</li>
<li>Test responsiveness on different devices.</li>
<li>Update to the latest Bootstrap version for new features and security.</li>
</ul>'],
],
'javascript' => [
['id' => 'js-1', 'title' => 'Topic #1: JS Fundamentals', 'description' => 'Variables, data types, and operators.', 'difficulty' => 'beginner',
'content' => '<h3>JavaScript Fundamentals</h3>
<p>JavaScript is a programming language for web development. It lets you add interactivity, logic, and dynamic content to your pages.</p>
<h4>Variables</h4>
<pre><code>
let name = "Alice";
const age = 21;
var isStudent = true;
</code></pre>
<ul>
<li><strong>let</strong>: Block-scoped variable.</li>
<li><strong>const</strong>: Block-scoped constant (cannot be reassigned).</li>
<li><strong>var</strong>: Function-scoped variable (legacy, use let/const instead).</li>
</ul>
<h4>Data Types</h4>
<ul>
<li>Number, String, Boolean, Object, Array, Null, Undefined</li>
</ul>
<h4>Operators</h4>
<pre><code>
let sum = 3 + 5;
let isEqual = (a === b);
</code></pre>'],
['id' => 'js-2', 'title' => 'Topic #2: Control Flow', 'description' => 'If statements, loops, and logic.', 'difficulty' => 'beginner',
'content' => '<h3>Control Flow</h3>
<p>Control the logic of your programs using if statements, loops, and conditions.</p>
<h4>If Statements</h4>
<pre><code>
if (score > 80) {
alert("Great job!");
} else {
alert("Keep practicing!");
}
</code></pre>
<h4>Loops</h4>
<pre><code>
for (let i = 0; i < 5; i++) {
console.log(i);
}
let n = 0;
while (n < 3) {
console.log(n);
n++;
}
</code></pre>
<h4>Logic</h4>
<p>Use <code>&&</code> (and), <code>||</code> (or), <code>!</code> (not) to build complex conditions.</p>'],
['id' => 'js-3', 'title' => 'Topic #3: Functions', 'description' => 'Defining and using functions.', 'difficulty' => 'beginner',
'content' => '<h3>Functions</h3>
<p>Functions group code to reuse and organize logic.</p>
<pre><code>
function greet(name) {
return "Hello, " + name + "!";
}
console.log(greet("Alice"));
</code></pre>
<h4>Arrow Functions (ES6)</h4>
<pre><code>
const add = (a, b) => a + b;
console.log(add(2, 3));
</code></pre>'],
['id' => 'js-4', 'title' => 'Topic #4: DOM Basics', 'description' => 'Manipulate the web page with JavaScript.', 'difficulty' => 'beginner',
'content' => '<h3>DOM Basics</h3>
<p>The DOM (Document Object Model) lets JavaScript interact with HTML elements.</p>
<pre><code>
const heading = document.getElementById("main-title");
heading.textContent = "New Title!";
</code></pre>
<ul>
<li><code>getElementById</code>, <code>querySelector</code>: Select elements.</li>
<li><code>textContent</code>, <code>innerHTML</code>: Change content.</li>
<li><code>style</code>: Change CSS.</li>
</ul>
<pre><code>
document.body.style.backgroundColor = "lightblue";
</code></pre>'],
['id' => 'js-5', 'title' => 'Topic #5: Events', 'description' => 'Respond to user actions.', 'difficulty' => 'intermediate',
'content' => '<h3>Events</h3>
<p>Respond to user actions like clicks, keypresses, and more.</p>
<pre><code>
document.getElementById("btn").addEventListener("click", function() {
alert("Button clicked!");
});
</code></pre>
<ul>
<li><code>addEventListener</code>: Attach event handlers.</li>
<li>Common events: <code>click</code>, <code>mouseover</code>, <code>keydown</code>, <code>submit</code></li>
</ul>'],
['id' => 'js-6', 'title' => 'Topic #6: Objects & Arrays', 'description' => 'Work with complex data structures.', 'difficulty' => 'intermediate',
'content' => '<h3>Objects</h3>
<pre><code>
const user = {
name: "Bob",
age: 20,
isStudent: true
};
console.log(user.name);
</code></pre>
<h3>Arrays</h3>
<pre><code>
const fruits = ["apple", "banana", "cherry"];
console.log(fruits[1]); // "banana"
fruits.push("orange");
</code></pre>'],
['id' => 'js-7', 'title' => 'Topic #7:ES6+ Features', 'description' => 'Modern JavaScript syntax and features.', 'difficulty' => 'intermediate',
'content' => '<h3>ES6+ Modern JavaScript Features</h3>
<ul>
<li><strong>let</strong> and <strong>const</strong> for variables</li>
<li><strong>Arrow Functions</strong>: <code>(x) => x * 2</code></li>
<li><strong>Template Literals</strong>: <code>`Hello, ${name}!`</code></li>
<li><strong>Destructuring</strong>: <code>const [a, b] = arr;</code> or <code>const {name} = user;</code></li>
<li><strong>Default Parameters</strong>: <code>function f(x = 1) {...}</code></li>
<li><strong>Spread Operator</strong>: <code>const arr2 = [...arr1, 4]</code></li>
</ul>'],
['id' => 'js-8', 'title' => 'Topic #8: Async JS', 'description' => 'Promises, async/await, and AJAX.', 'difficulty' => 'expert',
'content' => '<h3>Async JavaScript</h3>
<p>Handle asynchronous operations like network requests and timers.</p>
<h4>Promises</h4>
<pre><code>
const promise = fetch("https://api.example.com/data");
promise.then(response => response.json()).then(data => {
console.log(data);
});
</code></pre>
<h4>Async/Await</h4>
<pre><code>
async function getData() {
const response = await fetch("https://api.example.com/data");
const data = await response.json();
console.log(data);
}
getData();
</code></pre>'],
['id' => 'js-9', 'title' => 'Topic #9: Modules & Tooling', 'description' => 'Organize and build JS projects.', 'difficulty' => 'expert',
'content' => '<h3>Modules & Tooling</h3>
<p>Organize code into reusable files and use tools for building projects.</p>
<h4>Modules (ES6)</h4>
<pre><code>
// math.js
export function add(a, b) {
return a + b;
}
// app.js
import { add } from "./math.js";
console.log(add(2, 3));
</code></pre>
<h4>Tooling</h4>
<ul>
<li>Use npm/yarn for package management.</li>
<li>Use build tools like Webpack, Vite, or Parcel.</li>
</ul>'],
['id' => 'js-10', 'title' => 'Topic #10: JS Best Practices', 'description' => 'Write clean and efficient JavaScript.', 'difficulty' => 'expert',
'content' => '<h3>JavaScript Best Practices</h3>
<ul>
<li>Use <code>let</code> and <code>const</code> for variables.</li>
<li>Comment your code and keep it readable.</li>
<li>Break logic into functions and modules.</li>
<li>Test your code and handle errors.</li>
<li>Keep up with modern JavaScript features.</li>
</ul>'],
],
'python' => [
['id' => 'python-1', 'title' => 'Topic #1: Python Basics', 'description' => 'Syntax, variables, and data types.', 'difficulty' => 'beginner',
'content' => '<h3>Python Basics</h3>
<p>Python is a popular, beginner-friendly programming language known for its simple syntax and readability.</p>
<h4>Variables & Data Types</h4>
<pre><code>
name = "Alice"
age = 21
is_student = True
</code></pre>
<ul>
<li>Common data types: <strong>int</strong>, <strong>float</strong>, <strong>str</strong>, <strong>bool</strong>, <strong>list</strong>, <strong>dict</strong></li>
</ul>
<h4>Printing</h4>
<pre><code>
print("Hello, World!")
</code></pre>
'],
['id' => 'python-2', 'title' => 'Topic #2: Control Structures', 'description' => 'If statements, loops, and logic.', 'difficulty' => 'beginner',
'content' => '<h3>Control Structures</h3>
<p>Control the flow of your programs using if statements and loops.</p>
<h4>If Statements</h4>
<pre><code>
if age >= 18:
print("Adult")
else:
print("Minor")
</code></pre>
<h4>Loops</h4>
<pre><code>
for i in range(5):
print(i)
n = 0
while n < 3:
print(n)
n += 1
</code></pre>
'],
['id' => 'python-3', 'title' => 'Topic #3: Functions', 'description' => 'Defining and using functions.', 'difficulty' => 'beginner',
'content' => '<h3>Functions</h3>
<p>Functions let you organize code into reusable blocks.</p>
<pre><code>
def greet(name):
return "Hello, " + name + "!"
print(greet("Alice"))
</code></pre>
<ul>
<li>Use <code>def</code> to define a function.</li>
<li>Return values using <code>return</code>.</li>
</ul>'],
['id' => 'python-4', 'title' => 'Topic #4: Data Structures', 'description' => 'Lists, tuples, sets, and dictionaries.', 'difficulty' => 'beginner',
'content' => '<h3>Data Structures</h3>
<ul>
<li><strong>Lists</strong>: Ordered, mutable collections.</li>
<li><strong>Tuples</strong>: Ordered, immutable collections.</li>
<li><strong>Sets</strong>: Unordered collections of unique elements.</li>
<li><strong>Dictionaries</strong>: Key-value pairs.</li>
</ul>
<pre><code>
fruits = ["apple", "banana", "cherry"]
info = {"name": "Alice", "age": 21}
</code></pre>'],
['id' => 'python-5', 'title' => 'Topic #5: OOP in Python', 'description' => 'Classes and objects in Python.', 'difficulty' => 'intermediate',
'content' => '<h3>Object-Oriented Programming (OOP)</h3>
<p>Python supports OOP with classes and objects.</p>
<pre><code>
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
def greet(self):
print("Hello, my name is", self.name)
alice = Person("Alice", 21)
alice.greet()
</code></pre>
<ul>
<li><code>__init__</code>: Constructor method.</li>
<li><code>self</code>: Refers to the instance.</li>
</ul>'],
['id' => 'python-6', 'title' => 'Topic #6: Modules & Packages', 'description' => 'Organize and reuse code.', 'difficulty' => 'intermediate',
'content' => '<h3>Modules & Packages</h3>
<p>Modules help you organize code, and packages group modules together.</p>
<h4>Importing Modules</h4>
<pre><code>
import math