-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.js
More file actions
925 lines (915 loc) · 92.8 KB
/
Copy pathdata.js
File metadata and controls
925 lines (915 loc) · 92.8 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
// ============================================================
// DATA.JS — Complete Python Roadmap Data
// All content, phases, topics, quizzes, projects, etc.
// ============================================================
const ROADMAP_DATA = {
phases: [
{
id: 0,
title: "Phase 0: Foundations & Setup",
subtitle: "Computer Basics, Tools & Mindset",
color: "#6366f1",
gradient: "linear-gradient(135deg, #667eea 0%, #764ba2 100%)",
icon: "🖥️",
estimatedTime: "1-2 weeks",
difficulty: "Absolute Beginner",
topics: [
{
id: "p0t1", title: "Computer Basics", icon: "💻",
overview: "Understand how computers work at a fundamental level. Learn about CPU, RAM, Storage, Operating Systems, and how programs execute.",
why: "Every programmer must understand the machine they're programming. This foundation prevents confusion and helps with debugging.",
theory: "A computer processes instructions through its CPU (Central Processing Unit). Data is temporarily stored in RAM (Random Access Memory) and permanently in storage (HDD/SSD). The OS manages all resources.",
examples: ["Opening Task Manager to see CPU/RAM usage", "Understanding why programs crash (out of memory)", "How file systems organize your data"],
codeExamples: [],
exercises: ["Identify the specs of your computer", "List 5 processes running on your machine", "Calculate how much RAM your browser uses"],
interview: ["What is the difference between RAM and ROM?", "How does a CPU execute instructions?", "What is an operating system?"],
mcqs: [
{ q: "What does CPU stand for?", options: ["Central Processing Unit", "Computer Processing Unit", "Central Program Unit", "Core Processing Utility"], answer: 0, explanation: "CPU stands for Central Processing Unit — the brain of the computer." },
{ q: "What is RAM used for?", options: ["Permanent storage", "Temporary fast storage", "Processing graphics", "Network communication"], answer: 1, explanation: "RAM (Random Access Memory) is temporary, fast memory used while programs run." }
],
time: "3 days", difficulty: "Beginner"
},
{
id: "p0t2", title: "Command Line & Terminal", icon: "⌨️",
overview: "Master the command line interface (CLI). Learn to navigate directories, manage files, and execute programs through the terminal.",
why: "90% of professional development happens in the terminal. Knowing CLI makes you 10x more productive.",
theory: "The terminal is a text-based interface to your OS. Commands are typed and executed by pressing Enter. The shell (bash/zsh/cmd) interprets these commands.",
examples: ["ls / dir — list files", "cd — change directory", "mkdir — create folder", "rm — remove file", "cat — view file content"],
codeExamples: [
{ lang: "bash", code: "# Navigate to Desktop\ncd ~/Desktop\n\n# List all files\nls -la\n\n# Create a folder\nmkdir my_python_projects\n\n# Create a file\ntouch hello.py\n\n# View file contents\ncat hello.py\n\n# Move a file\nmv hello.py my_python_projects/\n\n# Remove a file\nrm old_file.txt" }
],
exercises: ["Navigate to 5 different directories using only the terminal", "Create a folder structure for your projects", "Find a file using the 'find' command"],
interview: ["What is the difference between terminal and shell?", "How do you find a file in Linux?", "What does chmod do?"],
mcqs: [
{ q: "Which command lists files in a directory?", options: ["show", "ls", "list", "dir"], answer: 1, explanation: "'ls' lists directory contents in Unix/Linux systems." },
{ q: "What does 'cd ..' do?", options: ["Create directory", "Go up one level", "Delete current folder", "Copy directory"], answer: 1, explanation: "'cd ..' moves up one level in the directory tree." }
],
time: "4 days", difficulty: "Beginner"
},
{
id: "p0t3", title: "Git & GitHub", icon: "🔀",
overview: "Learn version control with Git. Understand commits, branches, merging, and collaboration with GitHub.",
why: "Every professional developer uses Git daily. It's the industry standard for code management and collaboration.",
theory: "Git is a distributed version control system. It tracks changes to files over time, allowing you to revert to previous versions and collaborate with others.",
examples: ["Saving code versions", "Collaborating on open source", "Rolling back bad changes", "Feature branches"],
codeExamples: [
{ lang: "bash", code: "# Initialize a repository\ngit init\n\n# Check status\ngit status\n\n# Stage changes\ngit add .\n\n# Commit\ngit commit -m 'Initial commit'\n\n# Create branch\ngit checkout -b feature/login\n\n# Push to GitHub\ngit remote add origin https://github.com/user/repo.git\ngit push -u origin main\n\n# Pull latest changes\ngit pull origin main\n\n# View commit history\ngit log --oneline" }
],
exercises: ["Create a GitHub account", "Initialize a repo and make 5 commits", "Create and merge a branch"],
interview: ["What is the difference between git merge and git rebase?", "How do you resolve merge conflicts?", "What is git stash?"],
mcqs: [
{ q: "What does 'git commit' do?", options: ["Uploads to GitHub", "Saves a snapshot locally", "Deletes files", "Creates a branch"], answer: 1, explanation: "git commit saves a snapshot of staged changes to your local repository." },
{ q: "What is a branch in Git?", options: ["A copy of GitHub", "An independent line of development", "A deleted file", "A commit message"], answer: 1, explanation: "A branch is an independent line of development, allowing parallel work." }
],
time: "5 days", difficulty: "Beginner"
},
{
id: "p0t4", title: "VS Code Setup", icon: "📝",
overview: "Set up Visual Studio Code as your Python IDE. Install extensions, configure settings, and learn keyboard shortcuts.",
why: "VS Code is the most popular code editor in the world. Proper setup dramatically increases productivity.",
theory: "VS Code is a lightweight, extensible code editor by Microsoft. It supports Python through extensions and provides debugging, IntelliSense, and Git integration.",
examples: ["Python extension", "Pylint / Flake8", "Black formatter", "GitLens", "Thunder Client"],
codeExamples: [
{ lang: "json", code: "// settings.json for VS Code\n{\n \"python.defaultInterpreterPath\": \"/usr/bin/python3\",\n \"editor.formatOnSave\": true,\n \"editor.fontSize\": 14,\n \"editor.tabSize\": 4,\n \"python.linting.enabled\": true,\n \"python.linting.pylintEnabled\": true,\n \"workbench.colorTheme\": \"One Dark Pro\"\n}" }
],
exercises: ["Install VS Code and Python extension", "Configure auto-format on save", "Learn 10 keyboard shortcuts"],
interview: ["What is an IDE vs a text editor?", "What is IntelliSense?", "How do you debug Python in VS Code?"],
mcqs: [
{ q: "What does IntelliSense provide?", options: ["Internet access", "Code completion and suggestions", "Database management", "Git hosting"], answer: 1, explanation: "IntelliSense provides code completion, parameter info, and documentation." }
],
time: "2 days", difficulty: "Beginner"
},
{
id: "p0t5", title: "Programming Mindset", icon: "🧠",
overview: "Develop the problem-solving mindset of a programmer. Learn computational thinking, breaking problems down, and debugging strategies.",
why: "The biggest difference between beginners and experts is HOW they think about problems, not just what syntax they know.",
theory: "Computational thinking involves: Decomposition (breaking problems into parts), Pattern Recognition, Abstraction (ignoring irrelevant details), and Algorithm Design.",
examples: ["Breaking 'build a website' into 50 small tasks", "Debugging by eliminating possibilities", "Googling effectively (error message + language)"],
codeExamples: [],
exercises: ["Solve 5 logic puzzles", "Write pseudo-code for 3 real-world problems", "Document your debugging process for a fake bug"],
interview: ["How do you approach a problem you've never seen before?", "What is your debugging strategy?", "How do you stay updated with technology?"],
mcqs: [
{ q: "What is decomposition in computational thinking?", options: ["Deleting code", "Breaking problems into smaller parts", "Writing documentation", "Testing code"], answer: 1, explanation: "Decomposition means breaking a complex problem into smaller, manageable parts." }
],
time: "3 days", difficulty: "Beginner"
}
]
},
{
id: 1,
title: "Phase 1: Python Basics",
subtitle: "Syntax, Variables, Data Types & I/O",
color: "#10b981",
gradient: "linear-gradient(135deg, #11998e 0%, #38ef7d 100%)",
icon: "🐍",
estimatedTime: "2-3 weeks",
difficulty: "Beginner",
topics: [
{
id: "p1t1", title: "Python Installation", icon: "⚙️",
overview: "Install Python on your system, understand versions, and set up your first environment.",
why: "You need Python installed before you can write any Python code.",
theory: "Python 3.x is the current standard. Python 2 is deprecated. Download from python.org. Use pyenv to manage multiple versions.",
examples: ["python --version", "pip --version", "Running python3 in terminal"],
codeExamples: [
{ lang: "bash", code: "# Check Python version\npython3 --version\n\n# Check pip\npip3 --version\n\n# Install a package\npip install requests\n\n# List installed packages\npip list\n\n# Run a Python file\npython3 hello.py\n\n# Start Python REPL\npython3" }
],
exercises: ["Install Python 3.11+", "Run your first Python file", "Install 3 packages with pip"],
interview: ["What is the difference between Python 2 and 3?", "What is pip?", "What is a virtual environment?"],
mcqs: [
{ q: "What is the current recommended Python version?", options: ["Python 2.7", "Python 3.x", "Python 1.0", "Python 4.0"], answer: 1, explanation: "Python 3.x is the current standard. Python 2 reached end-of-life in 2020." }
],
time: "1 day", difficulty: "Beginner"
},
{
id: "p1t2", title: "Variables & Data Types", icon: "📦",
overview: "Learn Python's dynamic typing system. Understand int, float, str, bool, and None types.",
why: "Variables are the foundation of every program. Understanding types prevents 90% of beginner errors.",
theory: "Python uses dynamic typing — you don't declare types. Python infers the type at runtime. Use type() to check types and isinstance() to validate.",
examples: ["age = 25 (int)", "price = 9.99 (float)", "name = 'Alice' (str)", "is_valid = True (bool)"],
codeExamples: [
{ lang: "python", code: "# Integer\nage = 25\nprint(type(age)) # <class 'int'>\n\n# Float\npi = 3.14159\nprint(type(pi)) # <class 'float'>\n\n# String\nname = 'Alice'\nprint(type(name)) # <class 'str'>\n\n# Boolean\nis_active = True\nprint(type(is_active)) # <class 'bool'>\n\n# None\nvalue = None\nprint(type(value)) # <class 'NoneType'>\n\n# Multiple assignment\nx, y, z = 1, 2, 3\n\n# Type conversion\nnum_str = '42'\nnum_int = int(num_str) # 42\nnum_float = float(num_str) # 42.0" }
],
exercises: ["Create variables of all types", "Convert between types", "Check types using isinstance()"],
interview: ["Is Python statically or dynamically typed?", "What is the difference between int and float?", "What is None in Python?"],
mcqs: [
{ q: "What is the type of True in Python?", options: ["int", "string", "bool", "NoneType"], answer: 2, explanation: "True and False are boolean literals in Python, of type 'bool'." },
{ q: "What does type() return for x = 3.14?", options: ["int", "float", "double", "decimal"], answer: 1, explanation: "3.14 is a float literal in Python." }
],
time: "3 days", difficulty: "Beginner"
},
{
id: "p1t3", title: "Strings & String Methods", icon: "🔤",
overview: "Master Python strings — creation, formatting, slicing, and the 40+ built-in string methods.",
why: "Strings are used in every program. Text processing is one of Python's strongest features.",
theory: "Strings in Python are immutable sequences of Unicode characters. They support slicing, indexing, and dozens of methods.",
examples: ["f-strings for formatting", "split/join for parsing", "upper/lower/strip for cleaning", "replace for substitution"],
codeExamples: [
{ lang: "python", code: "# String creation\ns1 = 'Hello'\ns2 = \"World\"\ns3 = '''Multi\nline\nstring'''\n\n# f-strings (Python 3.6+)\nname = 'Alice'\nage = 30\nprint(f'My name is {name} and I am {age} years old.')\n\n# String methods\ntext = ' Hello, World! '\nprint(text.strip()) # 'Hello, World!'\nprint(text.upper()) # ' HELLO, WORLD! '\nprint(text.lower()) # ' hello, world! '\nprint(text.replace('World', 'Python')) # 'Hello, Python!'\n\n# Slicing\ns = 'Python'\nprint(s[0]) # 'P'\nprint(s[-1]) # 'n'\nprint(s[1:4]) # 'yth'\nprint(s[::-1]) # 'nohtyP' (reverse)\n\n# Split and join\nwords = 'apple,banana,cherry'\nfruits = words.split(',') # ['apple', 'banana', 'cherry']\njoined = '-'.join(fruits) # 'apple-banana-cherry'\n\n# Check content\nprint('Hello'.startswith('He')) # True\nprint('World'.endswith('ld')) # True\nprint('42'.isdigit()) # True" }
],
exercises: ["Build a string formatter", "Count words in a sentence", "Reverse words in a string"],
interview: ["Are strings mutable in Python?", "What is string interning?", "How do you format strings in Python?"],
mcqs: [
{ q: "What does 'Python'[::-1] return?", options: ["Python", "nohtyP", "Pytho", "Error"], answer: 1, explanation: "[::-1] reverses the string, returning 'nohtyP'." },
{ q: "Which method removes whitespace from both ends?", options: ["clean()", "strip()", "trim()", "remove()"], answer: 1, explanation: "strip() removes leading and trailing whitespace." }
],
time: "4 days", difficulty: "Beginner"
},
{
id: "p1t4", title: "Input & Output", icon: "↕️",
overview: "Learn to take user input and display output. Understand print() formatting and input() parsing.",
why: "Every interactive program needs I/O. This is how your programs communicate with users.",
theory: "print() displays output to stdout. input() reads a line from stdin and returns it as a string. Always convert input types explicitly.",
codeExamples: [
{ lang: "python", code: "# Basic output\nprint('Hello, World!')\nprint('Value:', 42, 'Type:', type(42))\n\n# Print formatting\nname = 'Bob'\nage = 25\nprint(f'Name: {name}, Age: {age}')\nprint('Name: {}, Age: {}'.format(name, age))\nprint('Name: %s, Age: %d' % (name, age))\n\n# Print options\nprint('A', 'B', 'C', sep='-') # A-B-C\nprint('Hello', end=' ') # No newline\nprint('World') # Continues on same line\n\n# Input\nuser_name = input('Enter your name: ')\nuser_age = int(input('Enter your age: ')) # Convert to int\nuser_price = float(input('Enter price: ')) # Convert to float\n\nprint(f'Hello {user_name}, you are {user_age} years old!')" }
],
exercises: ["Build a simple calculator with input", "Create a personal info form", "Build a Mad Libs game"],
interview: ["What does input() always return?", "How do you print without a newline?", "What is the sep parameter in print()?"],
mcqs: [
{ q: "What type does input() always return?", options: ["int", "float", "str", "depends on input"], answer: 2, explanation: "input() always returns a string, regardless of what the user types." }
],
time: "2 days", difficulty: "Beginner"
},
{
id: "p1t5", title: "Operators", icon: "➕",
overview: "Master all Python operators: arithmetic, comparison, logical, bitwise, assignment, and identity operators.",
why: "Operators are the verbs of programming. Every expression uses them.",
theory: "Python has 7 types of operators. Understanding operator precedence prevents logic errors.",
codeExamples: [
{ lang: "python", code: "# Arithmetic\nprint(10 + 3) # 13\nprint(10 - 3) # 7\nprint(10 * 3) # 30\nprint(10 / 3) # 3.333...\nprint(10 // 3) # 3 (floor division)\nprint(10 % 3) # 1 (modulo)\nprint(10 ** 3) # 1000 (power)\n\n# Comparison\nprint(5 > 3) # True\nprint(5 < 3) # False\nprint(5 == 5) # True\nprint(5 != 3) # True\nprint(5 >= 5) # True\nprint(5 <= 4) # False\n\n# Logical\nprint(True and False) # False\nprint(True or False) # True\nprint(not True) # False\n\n# Assignment operators\nx = 10\nx += 5 # x = 15\nx -= 3 # x = 12\nx *= 2 # x = 24\nx //= 5 # x = 4\n\n# Identity & Membership\nprint(1 is 1) # True\nprint(1 is not 2) # True\nprint(3 in [1,2,3]) # True\nprint(4 not in [1,2,3]) # True" }
],
exercises: ["Calculate compound interest", "Check if a number is divisible by 3 and 5", "Use all 7 operator types"],
interview: ["What is the difference between == and is?", "What does // operator do?", "What is operator precedence?"],
mcqs: [
{ q: "What is the result of 17 % 5?", options: ["3", "2", "1", "0"], answer: 1, explanation: "17 % 5 = 2 (17 = 3*5 + 2, remainder is 2)." },
{ q: "What does ** operator do?", options: ["Multiply", "Power/Exponent", "Bitwise XOR", "Floor division"], answer: 1, explanation: "** is the exponentiation operator. 2**3 = 8." }
],
time: "3 days", difficulty: "Beginner"
}
]
},
{
id: 2,
title: "Phase 2: Control Flow",
subtitle: "Conditions, Loops & Logic",
color: "#f59e0b",
gradient: "linear-gradient(135deg, #f093fb 0%, #f5576c 100%)",
icon: "🔀",
estimatedTime: "2 weeks",
difficulty: "Beginner",
topics: [
{
id: "p2t1", title: "if / elif / else", icon: "🔀",
overview: "Master conditional statements to make decisions in your programs.",
theory: "Conditions evaluate to True or False. Python uses indentation (4 spaces) to define blocks.",
codeExamples: [
{ lang: "python", code: "# Basic if\nage = 18\nif age >= 18:\n print('Adult')\n\n# if-else\nscore = 75\nif score >= 60:\n print('Pass')\nelse:\n print('Fail')\n\n# if-elif-else\ngrade = 85\nif grade >= 90:\n print('A')\nelif grade >= 80:\n print('B')\nelif grade >= 70:\n print('C')\nelif grade >= 60:\n print('D')\nelse:\n print('F')\n\n# Ternary operator\nstatus = 'active' if age >= 18 else 'minor'\n\n# Nested if\ntemp = 25\nweather = 'sunny'\nif temp > 20:\n if weather == 'sunny':\n print('Perfect beach day!')\n else:\n print('Warm but cloudy')\n\n# match statement (Python 3.10+)\ncommand = 'quit'\nmatch command:\n case 'quit':\n print('Quitting...')\n case 'help':\n print('Showing help')\n case _:\n print('Unknown command')" }
],
exercises: ["Grade calculator", "BMI calculator", "Season detector"],
interview: ["What is short-circuit evaluation?", "What is the ternary operator in Python?", "How does match work in Python 3.10+?"],
mcqs: [
{ q: "What will 'A' if 10 > 5 else 'B' return?", options: ["B", "A", "Error", "None"], answer: 1, explanation: "10 > 5 is True, so the ternary returns 'A'." }
],
time: "4 days", difficulty: "Beginner"
},
{
id: "p2t2", title: "Loops: for & while", icon: "🔁",
overview: "Master iteration with for loops, while loops, break, continue, and else clauses.",
theory: "Loops repeat code. 'for' iterates over sequences. 'while' repeats while a condition is True.",
codeExamples: [
{ lang: "python", code: "# for loop\nfor i in range(5):\n print(i) # 0 1 2 3 4\n\n# Iterate over list\nfruits = ['apple', 'banana', 'cherry']\nfor fruit in fruits:\n print(fruit)\n\n# enumerate\nfor index, fruit in enumerate(fruits):\n print(f'{index}: {fruit}')\n\n# range with step\nfor i in range(0, 10, 2):\n print(i) # 0 2 4 6 8\n\n# while loop\ncount = 0\nwhile count < 5:\n print(count)\n count += 1\n\n# break and continue\nfor i in range(10):\n if i == 3:\n continue # skip 3\n if i == 7:\n break # stop at 7\n print(i)\n\n# for-else\nfor i in range(5):\n print(i)\nelse:\n print('Loop completed!') # runs if no break\n\n# Nested loops\nfor i in range(3):\n for j in range(3):\n print(f'({i},{j})', end=' ')\n print()" }
],
exercises: ["Print multiplication table", "Find all prime numbers up to 100", "FizzBuzz challenge"],
interview: ["What is the difference between break and continue?", "What does the else clause do in a loop?", "How do you iterate with index?"],
mcqs: [
{ q: "What does 'continue' do in a loop?", options: ["Exits the loop", "Skips current iteration", "Restarts the loop", "Pauses execution"], answer: 1, explanation: "'continue' skips the rest of the current iteration and moves to the next." }
],
time: "5 days", difficulty: "Beginner"
}
]
},
{
id: 3,
title: "Phase 3: Data Structures",
subtitle: "Lists, Tuples, Dicts, Sets",
color: "#8b5cf6",
gradient: "linear-gradient(135deg, #4776E6 0%, #8E54E9 100%)",
icon: "📊",
estimatedTime: "3 weeks",
difficulty: "Beginner-Intermediate",
topics: [
{
id: "p3t1", title: "Lists", icon: "📋",
overview: "Master Python's most versatile data structure — lists. Learn creation, indexing, slicing, methods, and list comprehensions.",
theory: "Lists are ordered, mutable sequences. They can hold any type. They support indexing, slicing, and many methods.",
codeExamples: [
{ lang: "python", code: "# Create\nfruits = ['apple', 'banana', 'cherry']\nnumbers = [1, 2, 3, 4, 5]\nmixed = [1, 'hello', 3.14, True]\n\n# Access\nprint(fruits[0]) # apple\nprint(fruits[-1]) # cherry\nprint(fruits[1:3]) # ['banana', 'cherry']\n\n# Methods\nfruits.append('grape') # Add to end\nfruits.insert(1, 'mango') # Insert at index\nfruits.remove('banana') # Remove by value\npopped = fruits.pop() # Remove & return last\nfruits.sort() # Sort in place\nfruits.reverse() # Reverse in place\nprint(len(fruits)) # Length\nprint(fruits.count('apple'))# Count occurrences\nprint(fruits.index('apple'))# Find index\n\n# List comprehension\nsquares = [x**2 for x in range(10)]\nevens = [x for x in range(20) if x % 2 == 0]\nmatrix = [[i*j for j in range(3)] for i in range(3)]\n\n# Copy\noriginal = [1, 2, 3]\nshallow = original.copy()\nfull_copy = original[:]" }
],
exercises: ["Find max/min without built-ins", "Remove duplicates from list", "Flatten nested list"],
interview: ["What is the difference between append and extend?", "How do you copy a list properly?", "What is list comprehension?"],
mcqs: [
{ q: "What does list.pop() return?", options: ["Nothing", "First element", "Last element", "Length"], answer: 2, explanation: "pop() removes and returns the last element (or element at given index)." }
],
time: "5 days", difficulty: "Beginner"
},
{
id: "p3t2", title: "Dictionaries", icon: "📖",
overview: "Master Python dictionaries — key-value stores. Learn CRUD operations, methods, and dict comprehensions.",
theory: "Dicts are hash maps — O(1) lookup. Keys must be hashable (strings, numbers, tuples). Values can be anything.",
codeExamples: [
{ lang: "python", code: "# Create\nperson = {'name': 'Alice', 'age': 30, 'city': 'NYC'}\n\n# Access\nprint(person['name']) # Alice\nprint(person.get('age', 0)) # 30 (safe access)\n\n# Modify\nperson['email'] = 'alice@example.com' # Add\nperson['age'] = 31 # Update\ndel person['city'] # Delete\n\n# Methods\nprint(person.keys()) # dict_keys(['name', 'age', 'email'])\nprint(person.values()) # dict_values([...])\nprint(person.items()) # dict_items([...])\n\n# Iteration\nfor key, value in person.items():\n print(f'{key}: {value}')\n\n# Dict comprehension\nsquares = {x: x**2 for x in range(5)}\nfiltered = {k: v for k, v in person.items() if v != 'Alice'}\n\n# Nested dict\nstudents = {\n 'Alice': {'grade': 'A', 'score': 95},\n 'Bob': {'grade': 'B', 'score': 82}\n}\nprint(students['Alice']['score']) # 95\n\n# Merge dicts (Python 3.9+)\nd1 = {'a': 1}\nd2 = {'b': 2}\nd3 = d1 | d2 # {'a': 1, 'b': 2}" }
],
exercises: ["Word frequency counter", "Phone book app", "Group students by grade"],
interview: ["What makes a good dictionary key?", "What is defaultdict?", "How do you handle missing keys?"],
mcqs: [
{ q: "What does dict.get(key, default) do?", options: ["Raises error if missing", "Returns default if key missing", "Adds key with default", "Deletes key"], answer: 1, explanation: "get() safely returns a default value if the key doesn't exist." }
],
time: "5 days", difficulty: "Beginner"
},
{
id: "p3t3", title: "Tuples & Sets", icon: "🔢",
overview: "Learn immutable tuples and unordered sets. Understand when to use each.",
theory: "Tuples are immutable lists. Sets are unordered collections of unique elements. Both have specific use cases.",
codeExamples: [
{ lang: "python", code: "# Tuples (immutable)\ncoordinates = (10.5, 20.3)\nrgb = (255, 128, 0)\nperson = ('Alice', 30, 'Engineer') # named tuple better here\n\n# Unpacking\nx, y = coordinates\nname, age, job = person\n\n# Tuple methods\nprint(coordinates.count(10.5)) # 1\nprint(coordinates.index(20.3)) # 1\n\n# Named tuples\nfrom collections import namedtuple\nPoint = namedtuple('Point', ['x', 'y'])\np = Point(3, 4)\nprint(p.x, p.y) # 3 4\n\n# Sets (unique unordered)\nfruits = {'apple', 'banana', 'cherry', 'apple'}\nprint(fruits) # {'apple', 'banana', 'cherry'}\n\n# Set operations\na = {1, 2, 3, 4}\nb = {3, 4, 5, 6}\nprint(a | b) # Union: {1,2,3,4,5,6}\nprint(a & b) # Intersection: {3,4}\nprint(a - b) # Difference: {1,2}\nprint(a ^ b) # Symmetric diff: {1,2,5,6}\n\n# Set methods\nfruits.add('grape')\nfruits.remove('banana')\nfruits.discard('notexist') # No error if missing" }
],
exercises: ["Remove duplicates from list using set", "Find common elements between two lists", "Build a contact book with tuples"],
interview: ["When would you use a tuple over a list?", "What is the time complexity of set lookup?", "How do set operations work?"],
mcqs: [
{ q: "What is the time complexity of 'x in set'?", options: ["O(n)", "O(log n)", "O(1)", "O(n²)"], answer: 2, explanation: "Set lookup is O(1) average case due to hash table implementation." }
],
time: "4 days", difficulty: "Intermediate"
}
]
},
{
id: 4,
title: "Phase 4: Functions",
subtitle: "Defining, Calling, Arguments & Scope",
color: "#ec4899",
gradient: "linear-gradient(135deg, #ee0979 0%, #ff6a00 100%)",
icon: "⚡",
estimatedTime: "2-3 weeks",
difficulty: "Intermediate",
topics: [
{
id: "p4t1", title: "Function Basics", icon: "⚡",
overview: "Master defining and calling functions. Learn parameters, return values, default args, and *args/**kwargs.",
theory: "Functions are reusable code blocks. DRY principle (Don't Repeat Yourself). Functions improve readability and maintainability.",
codeExamples: [
{ lang: "python", code: "# Basic function\ndef greet(name):\n return f'Hello, {name}!'\n\nprint(greet('Alice')) # Hello, Alice!\n\n# Default parameters\ndef power(base, exponent=2):\n return base ** exponent\n\nprint(power(3)) # 9\nprint(power(3, 3)) # 27\n\n# *args (variable positional)\ndef sum_all(*numbers):\n return sum(numbers)\n\nprint(sum_all(1, 2, 3, 4, 5)) # 15\n\n# **kwargs (variable keyword)\ndef display_info(**kwargs):\n for key, value in kwargs.items():\n print(f'{key}: {value}')\n\ndisplay_info(name='Alice', age=30, city='NYC')\n\n# Multiple return values\ndef min_max(numbers):\n return min(numbers), max(numbers)\n\nlo, hi = min_max([3, 1, 4, 1, 5, 9])\nprint(lo, hi) # 1 9\n\n# Type hints (Python 3.5+)\ndef add(x: int, y: int) -> int:\n return x + y\n\n# Docstrings\ndef calculate_bmi(weight: float, height: float) -> float:\n \"\"\"\n Calculate Body Mass Index.\n \n Args:\n weight: Weight in kilograms\n height: Height in meters\n \n Returns:\n BMI as float\n \"\"\"\n return weight / (height ** 2)" }
],
exercises: ["Fibonacci function", "Prime number checker", "Recursive factorial"],
interview: ["What is the difference between *args and **kwargs?", "What is a docstring?", "What is recursion?"],
mcqs: [
{ q: "What does *args allow?", options: ["Keyword arguments", "Variable positional arguments", "Default values", "Return multiple values"], answer: 1, explanation: "*args collects extra positional arguments into a tuple." }
],
time: "5 days", difficulty: "Intermediate"
},
{
id: "p4t2", title: "Lambda, Map, Filter, Reduce", icon: "λ",
overview: "Master functional programming tools in Python.",
theory: "Lambda creates anonymous functions. Map applies a function to all items. Filter selects items. Reduce aggregates.",
codeExamples: [
{ lang: "python", code: "from functools import reduce\n\n# Lambda\nsquare = lambda x: x ** 2\nprint(square(5)) # 25\n\nadd = lambda x, y: x + y\nprint(add(3, 4)) # 7\n\n# Map\nnumbers = [1, 2, 3, 4, 5]\nsquares = list(map(lambda x: x**2, numbers))\nprint(squares) # [1, 4, 9, 16, 25]\n\n# Filter\nevens = list(filter(lambda x: x % 2 == 0, numbers))\nprint(evens) # [2, 4]\n\n# Reduce\nproduct = reduce(lambda x, y: x * y, numbers)\nprint(product) # 120\n\n# Practical example: sort by key\nstudents = [('Alice', 95), ('Bob', 87), ('Charlie', 92)]\nsorted_students = sorted(students, key=lambda s: s[1], reverse=True)\nprint(sorted_students) # Alice, Charlie, Bob" }
],
exercises: ["Use map to convert temperatures", "Filter palindromes from a list", "Use reduce to find the max"],
interview: ["What is a lambda function?", "When would you use map vs list comprehension?", "What does reduce do?"],
mcqs: [
{ q: "What does filter() return?", options: ["A list", "A filter object (iterator)", "A tuple", "A set"], answer: 1, explanation: "filter() returns a filter object (lazy iterator) in Python 3." }
],
time: "3 days", difficulty: "Intermediate"
}
]
},
{
id: 5,
title: "Phase 5: OOP",
subtitle: "Object-Oriented Programming",
color: "#14b8a6",
gradient: "linear-gradient(135deg, #0f3443 0%, #34e89e 100%)",
icon: "🏛️",
estimatedTime: "3-4 weeks",
difficulty: "Intermediate",
topics: [
{
id: "p5t1", title: "Classes & Objects", icon: "🏛️",
overview: "Learn OOP fundamentals: classes, objects, attributes, methods, and constructors.",
theory: "OOP organizes code around objects (data + behavior). A class is a blueprint. An object is an instance of a class.",
codeExamples: [
{ lang: "python", code: "class BankAccount:\n \"\"\"A simple bank account.\"\"\"\n \n bank_name = 'PyBank' # Class attribute\n \n def __init__(self, owner: str, balance: float = 0.0):\n \"\"\"Initialize account.\"\"\"\n self.owner = owner # Instance attribute\n self.balance = balance\n self._transactions = [] # 'Protected' convention\n \n def deposit(self, amount: float) -> None:\n \"\"\"Deposit money.\"\"\"\n if amount <= 0:\n raise ValueError('Amount must be positive')\n self.balance += amount\n self._transactions.append(('deposit', amount))\n \n def withdraw(self, amount: float) -> None:\n \"\"\"Withdraw money.\"\"\"\n if amount > self.balance:\n raise InsufficientFundsError('Not enough funds')\n self.balance -= amount\n self._transactions.append(('withdraw', amount))\n \n def get_history(self) -> list:\n return self._transactions.copy()\n \n def __str__(self) -> str:\n return f'Account({self.owner}, ${self.balance:.2f})'\n \n def __repr__(self) -> str:\n return f'BankAccount(owner={self.owner!r}, balance={self.balance})'\n\n# Usage\naccount = BankAccount('Alice', 1000.0)\naccount.deposit(500)\naccount.withdraw(200)\nprint(account) # Account(Alice, $1300.00)" }
],
exercises: ["Build a Car class", "Create a Student management system", "Implement a Library class"],
interview: ["What is the difference between class and instance attributes?", "What is __init__?", "What is self?"],
mcqs: [
{ q: "What is __init__ in Python?", options: ["A destructor", "A constructor method", "A class method", "A static method"], answer: 1, explanation: "__init__ is the constructor called when creating a new instance." }
],
time: "7 days", difficulty: "Intermediate"
},
{
id: "p5t2", title: "Inheritance & Polymorphism", icon: "🧬",
overview: "Master inheritance, method overriding, super(), multiple inheritance, and polymorphism.",
theory: "Inheritance allows classes to inherit attributes and methods from parent classes. Polymorphism allows different classes to be treated uniformly.",
codeExamples: [
{ lang: "python", code: "class Animal:\n def __init__(self, name: str, sound: str):\n self.name = name\n self.sound = sound\n \n def speak(self) -> str:\n return f'{self.name} says {self.sound}'\n \n def __str__(self) -> str:\n return f'Animal({self.name})'\n\nclass Dog(Animal):\n def __init__(self, name: str):\n super().__init__(name, 'Woof')\n self.tricks = []\n \n def learn_trick(self, trick: str) -> None:\n self.tricks.append(trick)\n \n def show_tricks(self) -> str:\n return f'{self.name} knows: {\", \".join(self.tricks)}'\n\nclass GuideDog(Dog):\n def __init__(self, name: str, owner: str):\n super().__init__(name)\n self.owner = owner\n \n def speak(self) -> str: # Override\n return f'{self.name} (guide dog) says Woof quietly'\n\n# Polymorphism\nanimals = [Dog('Rex'), Animal('Cat', 'Meow'), GuideDog('Buddy', 'Alice')]\nfor animal in animals:\n print(animal.speak()) # Each uses its own speak()\n\n# isinstance and issubclass\nprint(isinstance(GuideDog('Max', 'Bob'), Dog)) # True\nprint(issubclass(GuideDog, Animal)) # True" }
],
exercises: ["Build a Shape hierarchy", "Create employee management with roles", "Implement a vehicle fleet system"],
interview: ["What is the MRO (Method Resolution Order)?", "What is super()?", "What is method overriding?"],
mcqs: [
{ q: "What does super() do?", options: ["Creates a copy", "Calls the parent class method", "Deletes parent", "Creates subclass"], answer: 1, explanation: "super() gives access to the parent class, useful for calling overridden methods." }
],
time: "5 days", difficulty: "Intermediate"
}
]
},
{
id: 6,
title: "Phase 6: Advanced Python",
subtitle: "Decorators, Generators, Context Managers",
color: "#f43f5e",
gradient: "linear-gradient(135deg, #c31432 0%, #240b36 100%)",
icon: "🚀",
estimatedTime: "3-4 weeks",
difficulty: "Advanced",
topics: [
{
id: "p6t1", title: "Decorators", icon: "🎨",
overview: "Master Python decorators — functions that modify other functions. Learn function decorators, class decorators, and built-ins.",
theory: "Decorators are higher-order functions. They take a function as input and return a modified function. Use @syntax.",
codeExamples: [
{ lang: "python", code: "import time\nimport functools\n\n# Basic decorator\ndef timer(func):\n @functools.wraps(func)\n def wrapper(*args, **kwargs):\n start = time.perf_counter()\n result = func(*args, **kwargs)\n end = time.perf_counter()\n print(f'{func.__name__} took {end-start:.4f}s')\n return result\n return wrapper\n\n@timer\ndef slow_function():\n time.sleep(0.1)\n return 'Done'\n\n# Decorator with arguments\ndef retry(max_attempts=3, delay=1):\n def decorator(func):\n @functools.wraps(func)\n def wrapper(*args, **kwargs):\n for attempt in range(max_attempts):\n try:\n return func(*args, **kwargs)\n except Exception as e:\n if attempt == max_attempts - 1:\n raise\n time.sleep(delay)\n return wrapper\n return decorator\n\n@retry(max_attempts=3, delay=0.5)\ndef flaky_api_call():\n import random\n if random.random() < 0.7:\n raise ConnectionError('Network error')\n return 'Success'\n\n# Built-in decorators\nclass Circle:\n def __init__(self, radius):\n self._radius = radius\n \n @property\n def radius(self):\n return self._radius\n \n @radius.setter\n def radius(self, value):\n if value < 0:\n raise ValueError('Radius cannot be negative')\n self._radius = value\n \n @staticmethod\n def info():\n return 'A circle is round'\n \n @classmethod\n def unit_circle(cls):\n return cls(radius=1)" }
],
exercises: ["Build a caching decorator", "Create a rate limiter decorator", "Implement logging decorator"],
interview: ["What is a decorator?", "What does functools.wraps do?", "Difference between @staticmethod and @classmethod?"],
mcqs: [
{ q: "What does @property create?", options: ["A static method", "A getter method", "A class method", "A decorator"], answer: 1, explanation: "@property creates a getter, allowing attribute-style access to a method." }
],
time: "6 days", difficulty: "Advanced"
},
{
id: "p6t2", title: "Generators & Iterators", icon: "🔄",
overview: "Master generators and iterators for memory-efficient data processing.",
theory: "Generators yield values lazily — one at a time. They're memory efficient for large datasets. Any function with 'yield' is a generator.",
codeExamples: [
{ lang: "python", code: "# Generator function\ndef fibonacci():\n a, b = 0, 1\n while True:\n yield a\n a, b = b, a + b\n\nfib = fibonacci()\nfor _ in range(10):\n print(next(fib), end=' ') # 0 1 1 2 3 5 8 13 21 34\n\n# Generator expression\ngen_squares = (x**2 for x in range(1000000)) # Memory efficient\nprint(sum(gen_squares)) # Computed lazily\n\n# Custom iterator\nclass Counter:\n def __init__(self, start, end):\n self.current = start\n self.end = end\n \n def __iter__(self):\n return self\n \n def __next__(self):\n if self.current > self.end:\n raise StopIteration\n value = self.current\n self.current += 1\n return value\n\nfor num in Counter(1, 5):\n print(num) # 1 2 3 4 5\n\n# yield from\ndef chain(*iterables):\n for iterable in iterables:\n yield from iterable\n\nresult = list(chain([1,2], [3,4], [5,6]))\nprint(result) # [1, 2, 3, 4, 5, 6]\n\n# Send values to generator\ndef accumulator():\n total = 0\n while True:\n value = yield total\n if value is None:\n break\n total += value\n\nacc = accumulator()\nnext(acc)\nprint(acc.send(10)) # 10\nprint(acc.send(20)) # 30" }
],
exercises: ["Infinite counter generator", "Read large file line by line", "Implement range() from scratch"],
interview: ["What is the difference between a list and a generator?", "What does yield do?", "What is lazy evaluation?"],
mcqs: [
{ q: "What keyword makes a function a generator?", options: ["return", "yield", "generate", "async"], answer: 1, explanation: "The 'yield' keyword makes a function a generator function." }
],
time: "5 days", difficulty: "Advanced"
}
]
},
{
id: 7,
title: "Phase 7: File Handling & Exceptions",
subtitle: "I/O, Error Handling & Context Managers",
color: "#06b6d4",
gradient: "linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%)",
icon: "📁",
estimatedTime: "2 weeks",
difficulty: "Intermediate",
topics: [
{
id: "p7t1", title: "File I/O", icon: "📁",
overview: "Read and write files in Python. Handle text files, binary files, CSV, JSON, and more.",
codeExamples: [
{ lang: "python", code: "import json\nimport csv\nfrom pathlib import Path\n\n# Read text file\nwith open('data.txt', 'r', encoding='utf-8') as f:\n content = f.read()\n lines = content.splitlines()\n\n# Write text file\nwith open('output.txt', 'w', encoding='utf-8') as f:\n f.write('Hello, File!\\n')\n f.writelines(['Line 1\\n', 'Line 2\\n'])\n\n# Append to file\nwith open('log.txt', 'a') as f:\n f.write('New log entry\\n')\n\n# JSON\ndata = {'name': 'Alice', 'scores': [95, 87, 92]}\nwith open('data.json', 'w') as f:\n json.dump(data, f, indent=2)\n\nwith open('data.json', 'r') as f:\n loaded = json.load(f)\n\n# CSV\nwith open('data.csv', 'w', newline='') as f:\n writer = csv.DictWriter(f, fieldnames=['name', 'age'])\n writer.writeheader()\n writer.writerow({'name': 'Alice', 'age': 30})\n\n# pathlib (modern approach)\npath = Path('my_folder') / 'data.txt'\npath.parent.mkdir(parents=True, exist_ok=True)\npath.write_text('Content here')\nprint(path.exists()) # True\nprint(path.suffix) # .txt" }
],
exercises: ["Build a log file parser", "Create a JSON config manager", "CSV data processor"],
interview: ["Why use 'with' for file handling?", "What is the difference between r, w, a modes?", "What is pathlib?"],
mcqs: [
{ q: "What does 'with open(file) as f' ensure?", options: ["File is encrypted", "File is properly closed", "File is backed up", "File is read-only"], answer: 1, explanation: "The 'with' statement (context manager) ensures the file is properly closed even if an error occurs." }
],
time: "4 days", difficulty: "Intermediate"
},
{
id: "p7t2", title: "Exceptions & Error Handling", icon: "⚠️",
overview: "Master try/except/else/finally, custom exceptions, and error handling strategies.",
codeExamples: [
{ lang: "python", code: "# Basic exception handling\ntry:\n result = 10 / 0\nexcept ZeroDivisionError as e:\n print(f'Error: {e}')\nelse:\n print(f'Result: {result}') # Runs if no exception\nfinally:\n print('Always runs')\n\n# Multiple exceptions\ntry:\n value = int(input('Enter number: '))\n result = 100 / value\nexcept ValueError:\n print('Not a number!')\nexcept ZeroDivisionError:\n print('Cannot divide by zero!')\nexcept Exception as e:\n print(f'Unexpected error: {e}')\n\n# Custom exceptions\nclass InsufficientFundsError(Exception):\n def __init__(self, amount, balance):\n self.amount = amount\n self.balance = balance\n super().__init__(\n f'Cannot withdraw {amount}. Balance: {balance}'\n )\n\nclass BankAccount:\n def __init__(self, balance):\n self.balance = balance\n \n def withdraw(self, amount):\n if amount > self.balance:\n raise InsufficientFundsError(amount, self.balance)\n self.balance -= amount\n\n# Exception chaining\ntry:\n open('nonexistent.txt')\nexcept FileNotFoundError as e:\n raise RuntimeError('Config file missing') from e" }
],
exercises: ["Safe division function", "File reader with fallback", "Custom validation exceptions"],
interview: ["What is the difference between Exception and BaseException?", "When should you create custom exceptions?", "What does 'raise from' do?"],
mcqs: [
{ q: "Which block always executes in try/except?", options: ["try", "except", "else", "finally"], answer: 3, explanation: "'finally' always executes, whether or not an exception occurred." }
],
time: "4 days", difficulty: "Intermediate"
}
]
},
{
id: 8,
title: "Phase 8: Modules & Packages",
subtitle: "Organizing Code & Package Management",
color: "#a855f7",
gradient: "linear-gradient(135deg, #7b2ff7 0%, #f107a3 100%)",
icon: "📦",
estimatedTime: "2 weeks",
difficulty: "Intermediate",
topics: [
{
id: "p8t1", title: "Modules & Imports", icon: "📦",
overview: "Learn to organize code into modules. Master import syntax, __name__, and the standard library.",
codeExamples: [
{ lang: "python", code: "# Import styles\nimport math\nfrom math import sqrt, pi\nfrom math import sqrt as square_root\nimport os.path as osp\n\n# Using standard library\nimport datetime\nimport random\nimport collections\nimport itertools\n\n# datetime\nnow = datetime.datetime.now()\nprint(now.strftime('%Y-%m-%d %H:%M:%S'))\n\n# random\nprint(random.randint(1, 100))\nprint(random.choice(['apple', 'banana', 'cherry']))\nrandom.shuffle([1, 2, 3, 4, 5])\n\n# collections\nfrom collections import Counter, defaultdict, deque, OrderedDict\n\nword_count = Counter('hello world hello'.split())\nprint(word_count) # Counter({'hello': 2, 'world': 1})\n\n# itertools\nfrom itertools import chain, combinations, permutations, product\nitems = list(combinations([1,2,3], 2))\nprint(items) # [(1,2), (1,3), (2,3)]\n\n# __name__ guard\nif __name__ == '__main__':\n print('Running as main script')\n # Not a module import" }
],
exercises: ["Build a math utilities module", "Create a date formatter", "Implement a statistics calculator"],
interview: ["What is __name__?", "What is the standard library?", "How does Python find modules?"],
mcqs: [
{ q: "What does 'if __name__ == \"__main__\":' do?", options: ["Imports module", "Runs only when script is executed directly", "Creates a class", "Defines main function"], answer: 1, explanation: "This check ensures code only runs when the script is executed directly, not imported." }
],
time: "4 days", difficulty: "Intermediate"
}
]
},
{
id: 9,
title: "Phase 9: Testing & Debugging",
subtitle: "unittest, pytest & Debugging Strategies",
color: "#22c55e",
gradient: "linear-gradient(135deg, #134e5e 0%, #71b280 100%)",
icon: "🧪",
estimatedTime: "2-3 weeks",
difficulty: "Intermediate-Advanced",
topics: [
{
id: "p9t1", title: "unittest & pytest", icon: "🧪",
overview: "Master Python testing with unittest and pytest. Learn TDD, mocking, fixtures, and test coverage.",
codeExamples: [
{ lang: "python", code: "# unittest example\nimport unittest\n\ndef add(a, b):\n return a + b\n\ndef divide(a, b):\n if b == 0:\n raise ZeroDivisionError('Cannot divide by zero')\n return a / b\n\nclass TestMath(unittest.TestCase):\n \n def setUp(self):\n \"\"\"Run before each test.\"\"\"\n self.numbers = [1, 2, 3, 4, 5]\n \n def test_add_positive(self):\n self.assertEqual(add(2, 3), 5)\n \n def test_add_negative(self):\n self.assertEqual(add(-1, -2), -3)\n \n def test_divide_normal(self):\n self.assertAlmostEqual(divide(10, 3), 3.333, places=3)\n \n def test_divide_by_zero(self):\n with self.assertRaises(ZeroDivisionError):\n divide(10, 0)\n \n def tearDown(self):\n \"\"\"Run after each test.\"\"\"\n pass\n\n# pytest style (simpler)\ndef test_add():\n assert add(2, 3) == 5\n\ndef test_add_strings():\n assert add('Hello, ', 'World') == 'Hello, World'\n\n# pytest fixtures\nimport pytest\n\n@pytest.fixture\ndef sample_data():\n return {'name': 'Alice', 'age': 30}\n\ndef test_with_fixture(sample_data):\n assert sample_data['name'] == 'Alice'\n assert sample_data['age'] == 30\n\n# Mocking\nfrom unittest.mock import Mock, patch\n\ndef test_api_call():\n with patch('requests.get') as mock_get:\n mock_get.return_value.json.return_value = {'status': 'ok'}\n # test code here..." }
],
exercises: ["Write tests for a calculator", "TDD: build a stack class with tests first", "Mock an external API"],
interview: ["What is TDD?", "What is the difference between unit and integration tests?", "What is mocking?"],
mcqs: [
{ q: "What does setUp() do in unittest?", options: ["Tears down after tests", "Runs before each test", "Runs once before all tests", "Configures pytest"], answer: 1, explanation: "setUp() runs before each individual test method to prepare the test environment." }
],
time: "6 days", difficulty: "Advanced"
}
]
},
{
id: 10,
title: "Phase 10: Concurrency",
subtitle: "Threading, Multiprocessing & AsyncIO",
color: "#fb923c",
gradient: "linear-gradient(135deg, #f7971e 0%, #ffd200 100%)",
icon: "⚙️",
estimatedTime: "3-4 weeks",
difficulty: "Advanced",
topics: [
{
id: "p10t1", title: "AsyncIO", icon: "🔄",
overview: "Master asynchronous programming with asyncio, async/await, and event loops.",
codeExamples: [
{ lang: "python", code: "import asyncio\nimport aiohttp\nimport time\n\n# Basic async function\nasync def greet(name: str, delay: float) -> str:\n await asyncio.sleep(delay)\n return f'Hello, {name}!'\n\n# Running coroutines\nasync def main():\n # Sequential (slow)\n result1 = await greet('Alice', 1)\n result2 = await greet('Bob', 1)\n \n # Concurrent (fast)\n results = await asyncio.gather(\n greet('Alice', 1),\n greet('Bob', 1),\n greet('Charlie', 1)\n )\n print(results)\n\nasyncio.run(main())\n\n# Async HTTP requests\nasync def fetch_url(session, url: str) -> dict:\n async with session.get(url) as response:\n return await response.json()\n\nasync def fetch_multiple(urls: list) -> list:\n async with aiohttp.ClientSession() as session:\n tasks = [fetch_url(session, url) for url in urls]\n return await asyncio.gather(*tasks)\n\n# Async context manager\nclass AsyncDatabase:\n async def __aenter__(self):\n await self.connect()\n return self\n \n async def __aexit__(self, *args):\n await self.disconnect()\n \n async def connect(self): pass\n async def disconnect(self): pass\n\n# Async generator\nasync def async_range(stop: int):\n for i in range(stop):\n await asyncio.sleep(0)\n yield i\n\nasync def consume():\n async for value in async_range(5):\n print(value)" }
],
exercises: ["Async web scraper", "Async file processor", "Rate-limited API client"],
interview: ["What is the event loop?", "When to use asyncio vs threading?", "What is the GIL?"],
mcqs: [
{ q: "What does await do?", options: ["Blocks entire program", "Suspends coroutine until result ready", "Creates new thread", "Raises exception"], answer: 1, explanation: "await suspends the current coroutine, allowing the event loop to run other tasks." }
],
time: "7 days", difficulty: "Advanced"
}
]
},
{
id: 11,
title: "Phase 11: Web Development",
subtitle: "Flask, FastAPI & Django",
color: "#0ea5e9",
gradient: "linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%)",
icon: "🌐",
estimatedTime: "6-8 weeks",
difficulty: "Advanced",
topics: [
{
id: "p11t1", title: "FastAPI", icon: "⚡",
overview: "Build modern, fast REST APIs with FastAPI. Learn routing, models, validation, authentication, and deployment.",
codeExamples: [
{ lang: "python", code: "from fastapi import FastAPI, HTTPException, Depends, status\nfrom fastapi.security import HTTPBearer, HTTPAuthorizationCredentials\nfrom pydantic import BaseModel, EmailStr\nfrom typing import Optional, List\nimport uvicorn\n\napp = FastAPI(\n title='My API',\n description='A production-ready FastAPI example',\n version='1.0.0'\n)\n\n# Pydantic models\nclass UserCreate(BaseModel):\n name: str\n email: EmailStr\n age: int\n is_active: bool = True\n\nclass UserResponse(BaseModel):\n id: int\n name: str\n email: str\n\n# In-memory DB (use real DB in production)\nfake_db: dict = {}\ncounter = 0\n\n# Routes\n@app.get('/')\nasync def root():\n return {'message': 'Welcome to FastAPI!'}\n\n@app.post('/users', response_model=UserResponse, status_code=201)\nasync def create_user(user: UserCreate):\n global counter\n counter += 1\n fake_db[counter] = user.dict()\n return UserResponse(id=counter, **user.dict())\n\n@app.get('/users/{user_id}', response_model=UserResponse)\nasync def get_user(user_id: int):\n if user_id not in fake_db:\n raise HTTPException(status_code=404, detail='User not found')\n return UserResponse(id=user_id, **fake_db[user_id])\n\n@app.get('/users', response_model=List[UserResponse])\nasync def list_users(skip: int = 0, limit: int = 10):\n users = [\n UserResponse(id=uid, **data)\n for uid, data in fake_db.items()\n ]\n return users[skip:skip+limit]\n\nif __name__ == '__main__':\n uvicorn.run(app, host='0.0.0.0', port=8000)" }
],
exercises: ["Build a Todo API", "Create a user auth system", "Implement file upload endpoint"],
interview: ["What is FastAPI?", "How does Pydantic work?", "What is dependency injection?"],
mcqs: [
{ q: "What does FastAPI use for data validation?", options: ["Django forms", "WTForms", "Pydantic", "Cerberus"], answer: 2, explanation: "FastAPI uses Pydantic models for request/response validation and serialization." }
],
time: "10 days", difficulty: "Advanced"
}
]
},
{
id: 12,
title: "Phase 12: Databases",
subtitle: "SQL, NoSQL & ORMs",
color: "#d97706",
gradient: "linear-gradient(135deg, #eb5757 0%, #000000 100%)",
icon: "🗄️",
estimatedTime: "4-5 weeks",
difficulty: "Advanced",
topics: [
{
id: "p12t1", title: "SQLAlchemy ORM", icon: "🗄️",
overview: "Master SQLAlchemy for database interaction. Learn models, sessions, queries, relationships, and migrations.",
codeExamples: [
{ lang: "python", code: "from sqlalchemy import create_engine, Column, Integer, String, ForeignKey, DateTime\nfrom sqlalchemy.orm import DeclarativeBase, relationship, Session\nfrom sqlalchemy.sql import func\nimport datetime\n\n# Engine setup\nengine = create_engine('sqlite:///app.db', echo=True)\n\nclass Base(DeclarativeBase):\n pass\n\n# Models\nclass User(Base):\n __tablename__ = 'users'\n \n id = Column(Integer, primary_key=True)\n name = Column(String(100), nullable=False)\n email = Column(String(200), unique=True, nullable=False)\n created_at = Column(DateTime, default=func.now())\n posts = relationship('Post', back_populates='author')\n \n def __repr__(self):\n return f'<User(id={self.id}, name={self.name})>'\n\nclass Post(Base):\n __tablename__ = 'posts'\n \n id = Column(Integer, primary_key=True)\n title = Column(String(200), nullable=False)\n content = Column(String)\n user_id = Column(Integer, ForeignKey('users.id'))\n author = relationship('User', back_populates='posts')\n\n# Create tables\nBase.metadata.create_all(engine)\n\n# CRUD operations\nwith Session(engine) as session:\n # Create\n user = User(name='Alice', email='alice@example.com')\n session.add(user)\n session.commit()\n \n # Read\n users = session.query(User).filter(User.name.like('%Alice%')).all()\n \n # Update\n user.name = 'Alice Updated'\n session.commit()\n \n # Delete\n session.delete(user)\n session.commit()" }
],
exercises: ["Blog database schema", "E-commerce models", "User authentication with roles"],
interview: ["What is an ORM?", "What is a session in SQLAlchemy?", "How do you handle migrations?"],
mcqs: [
{ q: "What does ORM stand for?", options: ["Object Relational Mapper", "Object Runtime Module", "Online Resource Manager", "Optimized Read Model"], answer: 0, explanation: "ORM = Object Relational Mapper — maps Python objects to database tables." }
],
time: "8 days", difficulty: "Advanced"
}
]
},
{
id: 13,
title: "Phase 13: Docker & DevOps",
subtitle: "Containers, CI/CD & Infrastructure",
color: "#2563eb",
gradient: "linear-gradient(135deg, #005C97 0%, #363795 100%)",
icon: "🐳",
estimatedTime: "4-6 weeks",
difficulty: "Expert",
topics: [
{
id: "p13t1", title: "Docker", icon: "🐳",
overview: "Master Docker containerization. Learn Dockerfiles, images, containers, volumes, networks, and Docker Compose.",
codeExamples: [
{ lang: "dockerfile", code: "# Dockerfile for Python FastAPI app\nFROM python:3.11-slim\n\n# Set working directory\nWORKDIR /app\n\n# Install system dependencies\nRUN apt-get update && apt-get install -y \\\n gcc \\\n && rm -rf /var/lib/apt/lists/*\n\n# Copy requirements first (layer caching)\nCOPY requirements.txt .\nRUN pip install --no-cache-dir -r requirements.txt\n\n# Copy app code\nCOPY . .\n\n# Create non-root user\nRUN adduser --disabled-password --gecos '' appuser\nUSER appuser\n\n# Expose port\nEXPOSE 8000\n\n# Health check\nHEALTHCHECK --interval=30s --timeout=10s --start-period=5s \\\n CMD curl -f http://localhost:8000/health || exit 1\n\n# Run app\nCMD [\"uvicorn\", \"main:app\", \"--host\", \"0.0.0.0\", \"--port\", \"8000\"]" },
{ lang: "yaml", code: "# docker-compose.yml\nversion: '3.9'\n\nservices:\n api:\n build: .\n ports:\n - '8000:8000'\n environment:\n - DATABASE_URL=postgresql://user:pass@db:5432/mydb\n - REDIS_URL=redis://redis:6379\n depends_on:\n - db\n - redis\n volumes:\n - ./logs:/app/logs\n \n db:\n image: postgres:15\n environment:\n POSTGRES_USER: user\n POSTGRES_PASSWORD: pass\n POSTGRES_DB: mydb\n volumes:\n - postgres_data:/var/lib/postgresql/data\n \n redis:\n image: redis:7-alpine\n ports:\n - '6379:6379'\n\nvolumes:\n postgres_data:" }
],
exercises: ["Dockerize a FastAPI app", "Multi-container setup", "Production Docker setup"],
interview: ["What is a Docker image vs container?", "What is Docker Compose?", "What is a volume?"],
mcqs: [
{ q: "What does EXPOSE in Dockerfile do?", options: ["Opens firewall", "Documents port intent", "Starts a server", "Publishes port"], answer: 1, explanation: "EXPOSE documents which port the container listens on. It doesn't actually publish the port." }
],
time: "10 days", difficulty: "Expert"
}
]
},
{
id: 14,
title: "Phase 14: Cloud & AWS",
subtitle: "AWS, Azure, GCP & Cloud Architecture",
color: "#f97316",
gradient: "linear-gradient(135deg, #f83600 0%, #f9d423 100%)",
icon: "☁️",
estimatedTime: "6-8 weeks",
difficulty: "Expert",
topics: [
{
id: "p14t1", title: "AWS Core Services", icon: "☁️",
overview: "Master AWS fundamentals: IAM, EC2, S3, Lambda, RDS, VPC, and more.",
codeExamples: [
{ lang: "python", code: "import boto3\nfrom botocore.exceptions import ClientError\n\n# S3 Operations\ns3 = boto3.client('s3', region_name='us-east-1')\n\ndef upload_file(file_path: str, bucket: str, object_name: str = None):\n if object_name is None:\n object_name = file_path\n try:\n s3.upload_file(file_path, bucket, object_name)\n print(f'Uploaded {file_path} to {bucket}/{object_name}')\n except ClientError as e:\n print(f'Error: {e}')\n return False\n return True\n\ndef download_file(bucket: str, object_name: str, file_path: str):\n try:\n s3.download_file(bucket, object_name, file_path)\n except ClientError as e:\n print(f'Error: {e}')\n\n# Lambda function example\ndef lambda_handler(event, context):\n print(f'Event: {event}')\n name = event.get('name', 'World')\n return {\n 'statusCode': 200,\n 'body': f'Hello, {name}!'\n }\n\n# DynamoDB\ndynamodb = boto3.resource('dynamodb')\ntable = dynamodb.Table('Users')\n\ntable.put_item(Item={'userId': '1', 'name': 'Alice', 'email': 'alice@example.com'})\nresponse = table.get_item(Key={'userId': '1'})\nuser = response['Item']" }
],
exercises: ["Deploy app to EC2", "Create S3 file manager", "Build serverless Lambda API"],
interview: ["What is IAM?", "What is the difference between EC2 and Lambda?", "What is VPC?"],
mcqs: [
{ q: "What does S3 stand for?", options: ["Simple Storage System", "Simple Storage Service", "Secure Server Storage", "Scalable Storage System"], answer: 1, explanation: "S3 = Simple Storage Service — AWS's object storage service." }
],
time: "14 days", difficulty: "Expert"
}
]
},
{
id: 15,
title: "Phase 15: Data Science & ML",
subtitle: "Pandas, NumPy, Scikit-learn & AI",
color: "#7c3aed",
gradient: "linear-gradient(135deg, #200122 0%, #6f0000 100%)",
icon: "🤖",
estimatedTime: "8-10 weeks",
difficulty: "Expert",
topics: [
{
id: "p15t1", title: "Pandas & NumPy", icon: "📊",
overview: "Master data manipulation with Pandas and numerical computing with NumPy.",
codeExamples: [
{ lang: "python", code: "import pandas as pd\nimport numpy as np\n\n# NumPy\narr = np.array([1, 2, 3, 4, 5])\nmatrix = np.zeros((3, 3))\neye = np.eye(3) # Identity matrix\n\n# NumPy operations (vectorized)\na = np.array([1, 2, 3])\nb = np.array([4, 5, 6])\nprint(a + b) # [5 7 9]\nprint(a * b) # [4 10 18]\nprint(np.dot(a, b)) # 32\nprint(a.mean()) # 2.0\nprint(a.std()) # 0.816...\n\n# Pandas DataFrame\ndf = pd.DataFrame({\n 'name': ['Alice', 'Bob', 'Charlie'],\n 'age': [30, 25, 35],\n 'salary': [70000, 50000, 90000]\n})\n\n# Exploration\nprint(df.head())\nprint(df.describe())\nprint(df.dtypes)\nprint(df.shape)\n\n# Selection\nprint(df['name']) # Series\nprint(df[['name', 'age']]) # DataFrame\nprint(df[df['age'] > 28]) # Filter\nprint(df.iloc[0]) # First row by position\nprint(df.loc[0, 'name']) # By label\n\n# Operations\ndf['salary_k'] = df['salary'] / 1000\ndf['is_senior'] = df['age'] > 30\navg_salary = df.groupby('is_senior')['salary'].mean()\nprint(avg_salary)\n\n# Read/Write\ndf.to_csv('data.csv', index=False)\ndf_loaded = pd.read_csv('data.csv')\ndf.to_json('data.json', orient='records')" }
],
exercises: ["Analyze a CSV dataset", "Clean messy data", "Group and aggregate sales data"],
interview: ["What is a DataFrame?", "How do you handle missing values?", "What is vectorization?"],
mcqs: [
{ q: "What does df.describe() return?", options: ["Column names", "Statistical summary", "Data types", "Row count"], answer: 1, explanation: "describe() returns statistical summary (mean, std, min, max, percentiles) for numeric columns." }
],
time: "14 days", difficulty: "Expert"
}
]
}
]
};
// ============================================================
// PROJECTS DATA — 200+ Projects
// ============================================================
const PROJECTS_DATA = {
beginner: [
{ id: 1, title: "Hello World Variations", description: "Print creative hello world messages", skills: ["print", "strings"], time: "30 min", difficulty: "Beginner" },
{ id: 2, title: "Calculator", description: "Build a command-line calculator with all operations", skills: ["functions", "input", "operators"], time: "2 hours", difficulty: "Beginner" },
{ id: 3, title: "Number Guessing Game", description: "User guesses a random number with hints", skills: ["random", "loops", "input"], time: "1 hour", difficulty: "Beginner" },
{ id: 4, title: "Quiz App", description: "MCQ quiz with scoring and feedback", skills: ["dicts", "loops", "functions"], time: "3 hours", difficulty: "Beginner" },
{ id: 5, title: "Password Generator", description: "Generate secure random passwords", skills: ["random", "string", "functions"], time: "1 hour", difficulty: "Beginner" },
{ id: 6, title: "To-Do List CLI", description: "Add, remove, complete tasks from terminal", skills: ["lists", "file I/O", "functions"], time: "3 hours", difficulty: "Beginner" },
{ id: 7, title: "Expense Tracker", description: "Track daily expenses and show summaries", skills: ["dicts", "file I/O", "loops"], time: "4 hours", difficulty: "Beginner" },
{ id: 8, title: "Mad Libs Game", description: "Fill-in-the-blank story generator", skills: ["strings", "input", "f-strings"], time: "1 hour", difficulty: "Beginner" },
{ id: 9, title: "Temperature Converter", description: "Convert between Celsius, Fahrenheit, Kelvin", skills: ["functions", "math"], time: "1 hour", difficulty: "Beginner" },
{ id: 10, title: "BMI Calculator", description: "Calculate and categorize BMI", skills: ["math", "conditionals"], time: "1 hour", difficulty: "Beginner" },
{ id: 11, title: "Palindrome Checker", description: "Check if a word is a palindrome", skills: ["strings", "functions"], time: "45 min", difficulty: "Beginner" },
{ id: 12, title: "Fibonacci Generator", description: "Generate Fibonacci sequence", skills: ["loops", "recursion"], time: "1 hour", difficulty: "Beginner" },
{ id: 13, title: "Rock Paper Scissors", description: "Play against computer AI", skills: ["random", "conditionals", "loops"], time: "2 hours", difficulty: "Beginner" },
{ id: 14, title: "Word Counter", description: "Count words, characters, sentences in text", skills: ["strings", "dicts"], time: "1 hour", difficulty: "Beginner" },
{ id: 15, title: "Simple Alarm Clock", description: "Set alarm and play sound at time", skills: ["datetime", "time", "loops"], time: "2 hours", difficulty: "Beginner" },
{ id: 16, title: "Currency Converter", description: "Convert between currencies using static rates", skills: ["dicts", "functions", "math"], time: "2 hours", difficulty: "Beginner" },
{ id: 17, title: "Contact Book", description: "Add, search, delete contacts", skills: ["dicts", "file I/O", "functions"], time: "3 hours", difficulty: "Beginner" },
{ id: 18, title: "Hangman Game", description: "Classic word guessing game", skills: ["strings", "loops", "random"], time: "3 hours", difficulty: "Beginner" },
{ id: 19, title: "Multiplication Table", description: "Generate and display multiplication tables", skills: ["loops", "formatting"], time: "45 min", difficulty: "Beginner" },
{ id: 20, title: "Prime Number Finder", description: "Find all primes up to N", skills: ["loops", "math", "algorithms"], time: "1 hour", difficulty: "Beginner" }
],
intermediate: [
{ id: 21, title: "Web Scraper", description: "Scrape data from websites using requests/BeautifulSoup", skills: ["requests", "BeautifulSoup", "parsing"], time: "6 hours", difficulty: "Intermediate" },
{ id: 22, title: "File Organizer", description: "Auto-organize files by type into folders", skills: ["os", "shutil", "pathlib"], time: "4 hours", difficulty: "Intermediate" },
{ id: 23, title: "Weather App", description: "Fetch and display weather data from API", skills: ["requests", "JSON", "API"], time: "5 hours", difficulty: "Intermediate" },
{ id: 24, title: "Text-Based RPG", description: "Adventure game with inventory and combat", skills: ["OOP", "JSON", "file I/O"], time: "10 hours", difficulty: "Intermediate" },
{ id: 25, title: "Password Manager", description: "Store encrypted passwords securely", skills: ["cryptography", "OOP", "file I/O"], time: "8 hours", difficulty: "Intermediate" },
{ id: 26, title: "Markdown Viewer", description: "Convert Markdown to HTML and display", skills: ["markdown", "string processing"], time: "4 hours", difficulty: "Intermediate" },
{ id: 27, title: "CSV Analyzer", description: "Analyze CSV data and generate reports", skills: ["csv", "statistics", "file I/O"], time: "5 hours", difficulty: "Intermediate" },
{ id: 28, title: "Email Sender", description: "Send automated emails via SMTP", skills: ["smtplib", "email", "templates"], time: "4 hours", difficulty: "Intermediate" },
{ id: 29, title: "Image Resizer", description: "Batch resize images", skills: ["PIL/Pillow", "os", "pathlib"], time: "3 hours", difficulty: "Intermediate" },
{ id: 30, title: "YouTube Downloader", description: "Download videos from YouTube", skills: ["yt-dlp", "argparse", "progress"], time: "4 hours", difficulty: "Intermediate" },
{ id: 31, title: "Desktop Notifier", description: "Send desktop notifications", skills: ["plyer", "schedule"], time: "2 hours", difficulty: "Intermediate" },
{ id: 32, title: "URL Shortener", description: "Create short URLs using an API", skills: ["requests", "API", "JSON"], time: "3 hours", difficulty: "Intermediate" },
{ id: 33, title: "Wikipedia Scraper", description: "Extract info from Wikipedia articles", skills: ["wikipedia-api", "parsing"], time: "3 hours", difficulty: "Intermediate" },
{ id: 34, title: "Flashcard App", description: "Study flashcards with spaced repetition", skills: ["OOP", "JSON", "algorithms"], time: "8 hours", difficulty: "Intermediate" },
{ id: 35, title: "Pomodoro Timer", description: "Productivity timer with notifications", skills: ["tkinter", "threading", "time"], time: "5 hours", difficulty: "Intermediate" }
],
advanced: [
{ id: 51, title: "REST API with FastAPI", description: "Full CRUD API with JWT auth and database", skills: ["FastAPI", "SQLAlchemy", "JWT", "PostgreSQL"], time: "20 hours", difficulty: "Advanced" },
{ id: 52, title: "Discord Bot", description: "Feature-rich Discord bot with commands", skills: ["discord.py", "async", "database"], time: "15 hours", difficulty: "Advanced" },
{ id: 53, title: "Telegram Bot", description: "Telegram bot with inline keyboards", skills: ["python-telegram-bot", "async"], time: "12 hours", difficulty: "Advanced" },
{ id: 54, title: "Real-time Chat App", description: "WebSocket chat with rooms and auth", skills: ["FastAPI", "WebSockets", "Redis"], time: "25 hours", difficulty: "Advanced" },
{ id: 55, title: "Task Queue System", description: "Celery-based background task processing", skills: ["Celery", "Redis", "FastAPI"], time: "20 hours", difficulty: "Advanced" },
{ id: 56, title: "ML Pipeline", description: "End-to-end machine learning pipeline", skills: ["Pandas", "Scikit-learn", "MLflow"], time: "30 hours", difficulty: "Advanced" },
{ id: 57, title: "Browser Automation", description: "Automate web tasks with Playwright", skills: ["Playwright", "async", "automation"], time: "15 hours", difficulty: "Advanced" },
{ id: 58, title: "PDF Report Generator", description: "Generate professional PDF reports", skills: ["ReportLab", "Jinja2", "data viz"], time: "10 hours", difficulty: "Advanced" },
{ id: 59, title: "Stock Price Tracker", description: "Real-time stock data with alerts", skills: ["API", "pandas", "async", "notifications"], time: "20 hours", difficulty: "Advanced" },
{ id: 60, title: "Blockchain Demo", description: "Simple blockchain implementation", skills: ["hashing", "OOP", "algorithms"], time: "20 hours", difficulty: "Advanced" }
],
expert: [
{ id: 101, title: "SaaS Platform", description: "Full SaaS with auth, billing, multi-tenant", skills: ["Django", "Stripe", "PostgreSQL", "Docker"], time: "100+ hours", difficulty: "Expert" },
{ id: 102, title: "Microservices Architecture", description: "Multiple services with API gateway", skills: ["FastAPI", "Docker", "Kubernetes", "RabbitMQ"], time: "80 hours", difficulty: "Expert" },
{ id: 103, title: "DevOps Pipeline", description: "Complete CI/CD with monitoring", skills: ["GitHub Actions", "Docker", "K8s", "Prometheus"], time: "60 hours", difficulty: "Expert" },
{ id: 104, title: "LLM Application", description: "RAG system with LangChain and OpenAI", skills: ["LangChain", "OpenAI", "Vector DB"], time: "40 hours", difficulty: "Expert" },
{ id: 105, title: "Cloud Native App", description: "Fully cloud-native on AWS", skills: ["AWS", "Terraform", "EKS", "Helm"], time: "80 hours", difficulty: "Expert" },
{ id: 106, title: "Real-time Data Pipeline", description: "Kafka-based streaming data processing", skills: ["Kafka", "Python", "Spark", "Redis"], time: "60 hours", difficulty: "Expert" }
]
};
// ============================================================
// DAILY CHALLENGES DATA
// ============================================================
const DAILY_CHALLENGES = [
{ day: 1, title: "Hello World", description: "Print 'Hello, World!' in 5 different ways", difficulty: "Easy", topic: "Basics", points: 10 },
{ day: 2, title: "Variable Types", description: "Create one variable of each Python type and print them with type()", difficulty: "Easy", topic: "Data Types", points: 10 },
{ day: 3, title: "String Reversal", description: "Reverse a string without using [::-1]", difficulty: "Easy", topic: "Strings", points: 15 },
{ day: 4, title: "FizzBuzz", description: "Classic FizzBuzz for numbers 1-100", difficulty: "Easy", topic: "Loops", points: 15 },
{ day: 5, title: "Even/Odd Filter", description: "Separate even and odd numbers from a list", difficulty: "Easy", topic: "Lists", points: 15 },
{ day: 6, title: "Factorial", description: "Calculate factorial using recursion AND iteration", difficulty: "Easy", topic: "Functions", points: 20 },
{ day: 7, title: "Palindrome Check", description: "Check if a string is a palindrome (ignore case/spaces)", difficulty: "Easy", topic: "Strings", points: 20 },
{ day: 8, title: "Count Vowels", description: "Count vowels in a sentence", difficulty: "Easy", topic: "Strings", points: 15 },
{ day: 9, title: "List Flattening", description: "Flatten a nested list [[1,2],[3,[4,5]]] -> [1,2,3,4,5]", difficulty: "Medium", topic: "Lists", points: 25 },
{ day: 10, title: "Word Frequency", description: "Count word frequency in a paragraph", difficulty: "Medium", topic: "Dicts", points: 25 },
{ day: 11, title: "Anagram Check", description: "Check if two strings are anagrams", difficulty: "Medium", topic: "Strings", points: 25 },
{ day: 12, title: "Two Sum", description: "Find two numbers that add up to target", difficulty: "Medium", topic: "Algorithms", points: 30 },
{ day: 13, title: "Fibonacci Generator", description: "Build a generator for Fibonacci numbers", difficulty: "Medium", topic: "Generators", points: 30 },
{ day: 14, title: "Decorator Timer", description: "Build a decorator that times function execution", difficulty: "Medium", topic: "Decorators", points: 35 },
{ day: 15, title: "Binary Search", description: "Implement binary search algorithm", difficulty: "Medium", topic: "Algorithms", points: 35 },
{ day: 16, title: "Merge Sort", description: "Implement merge sort from scratch", difficulty: "Hard", topic: "Algorithms", points: 50 },
{ day: 17, title: "LRU Cache", description: "Implement an LRU cache using OrderedDict", difficulty: "Hard", topic: "OOP", points: 50 },
{ day: 18, title: "Async Web Fetcher", description: "Fetch 10 URLs concurrently with asyncio", difficulty: "Hard", topic: "Async", points: 60 },
{ day: 19, title: "Custom Context Manager", description: "Build a context manager using both approaches", difficulty: "Hard", topic: "Context Managers", points: 55 },
{ day: 20, title: "Type-Safe Stack", description: "Generic type-hinted Stack data structure", difficulty: "Hard", topic: "Generics", points: 55 },
{ day: 21, title: "Rate Limiter", description: "Build a token bucket rate limiter", difficulty: "Hard", topic: "Algorithms", points: 65 },
{ day: 22, title: "Regex Parser", description: "Parse log files with complex regex", difficulty: "Hard", topic: "Regex", points: 60 },
{ day: 23, title: "Observer Pattern", description: "Implement the observer design pattern", difficulty: "Hard", topic: "Design Patterns", points: 65 },
{ day: 24, title: "Graph BFS/DFS", description: "Implement BFS and DFS on a graph", difficulty: "Expert", topic: "Data Structures", points: 80 },
{ day: 25, title: "Mini Interpreter", description: "Build a calculator expression evaluator", difficulty: "Expert", topic: "Compilers", points: 100 }
];
// ============================================================
// QUIZ DATA — Per topic quizzes
// ============================================================
const QUIZ_DATA = {
python_basics: {
title: "Python Basics Quiz",
questions: [
{ q: "What is Python?", options: ["A snake", "A high-level programming language", "A database", "An operating system"], answer: 1, explanation: "Python is a high-level, interpreted, general-purpose programming language." },
{ q: "Which of these is NOT a Python data type?", options: ["int", "float", "double", "str"], answer: 2, explanation: "Python doesn't have a 'double' type. It has 'float' which is double-precision." },
{ q: "What does len() return?", options: ["Last element", "Length of object", "Type of object", "Memory size"], answer: 1, explanation: "len() returns the number of items in an object." },
{ q: "Which operator is used for floor division?", options: ["/", "//", "%", "**"], answer: 1, explanation: "// performs floor division (rounds down to nearest integer)." },
{ q: "What is the output of print(type([]))?", options: ["list", "<class 'list'>", "[]", "Error"], answer: 1, explanation: "type() returns the class type object. print() shows <class 'list'>." },
{ q: "Which is the correct way to create an empty dict?", options: ["dict = []", "dict = {}", "dict = ()", "dict = set()"], answer: 1, explanation: "{} creates an empty dictionary. [] creates an empty list." },
{ q: "What does 'is' operator check?", options: ["Value equality", "Identity (same object)", "Type equality", "String equality"], answer: 1, explanation: "'is' checks if two variables point to the same object in memory." },
{ q: "Which function converts string to integer?", options: ["str()", "float()", "int()", "num()"], answer: 2, explanation: "int() converts a string (or float) to an integer." },
{ q: "What is the result of bool('')?", options: ["True", "False", "Error", "None"], answer: 1, explanation: "Empty string is falsy. bool('') returns False." },
{ q: "How do you start a comment in Python?", options: ["//", "/*", "#", "--"], answer: 2, explanation: "Python uses # for single-line comments." }
]
},
oop: {
title: "OOP Concepts Quiz",
questions: [
{ q: "What is encapsulation?", options: ["Hiding implementation details", "Inheriting from parent class", "Overriding methods", "Creating instances"], answer: 0, explanation: "Encapsulation means bundling data and methods together and hiding internal details." },
{ q: "What is polymorphism?", options: ["Multiple inheritance", "Same interface, different behavior", "Class attributes", "Static methods"], answer: 1, explanation: "Polymorphism allows different classes to be used through the same interface." },
{ q: "What does @abstractmethod do?", options: ["Makes method static", "Requires subclasses to implement method", "Makes method private", "Caches method result"], answer: 1, explanation: "@abstractmethod forces subclasses to provide their own implementation." },
{ q: "What is a dunder method?", options: ["Private method", "Double underscore method like __init__", "Class method", "Property"], answer: 1, explanation: "Dunder (double underscore) methods like __init__, __str__ have special meaning in Python." },
{ q: "Which is correct for class attribute?", options: ["self.attr = val in __init__", "attr = val at class level", "cls.attr in __init__", "@classattr decorator"], answer: 1, explanation: "Class attributes are defined directly in the class body, outside any method." }
]
}
};
// ============================================================
// FLASHCARDS DATA
// ============================================================
const FLASHCARDS_DATA = [
{ id: 1, front: "What is a Python generator?", back: "A function that uses 'yield' to return values lazily, one at a time. Memory efficient for large sequences.", topic: "Advanced Python", difficulty: "Medium" },
{ id: 2, front: "What is the GIL?", back: "Global Interpreter Lock — a mutex that prevents multiple Python threads from executing simultaneously. Affects CPU-bound threading.", topic: "Concurrency", difficulty: "Hard" },
{ id: 3, front: "What is a decorator?", back: "A higher-order function that takes a function and returns a modified version. Used for cross-cutting concerns like logging, timing, auth.", topic: "Advanced Python", difficulty: "Medium" },
{ id: 4, front: "What is SOLID?", back: "S: Single Responsibility\nO: Open/Closed\nL: Liskov Substitution\nI: Interface Segregation\nD: Dependency Inversion", topic: "Design Patterns", difficulty: "Hard" },
{ id: 5, front: "What is a context manager?", back: "An object that defines __enter__ and __exit__ methods. Used with 'with' statement to manage resources (files, locks, DB connections).", topic: "Advanced Python", difficulty: "Medium" },
{ id: 6, front: "Difference between list and tuple?", back: "List: Mutable, uses [], slower. Tuple: Immutable, uses (), faster. Use tuples for fixed data, lists for dynamic data.", topic: "Data Structures", difficulty: "Easy" },
{ id: 7, front: "What is Big O notation?", back: "Describes algorithm time/space complexity as input grows. O(1)=constant, O(n)=linear, O(n²)=quadratic, O(log n)=logarithmic.", topic: "Algorithms", difficulty: "Medium" },
{ id: 8, front: "What is Docker?", back: "Platform for containerizing applications. Packages code + dependencies into isolated containers that run consistently anywhere.", topic: "DevOps", difficulty: "Medium" },
{ id: 9, front: "What is REST?", back: "Representational State Transfer. Architectural style for APIs using HTTP methods (GET, POST, PUT, DELETE) and stateless communication.", topic: "Web Dev", difficulty: "Medium" },
{ id: 10, front: "What is async/await?", back: "Python syntax for writing asynchronous code. 'async def' defines coroutine. 'await' suspends it until result is ready. Enables concurrent I/O.", topic: "Async", difficulty: "Hard" },
{ id: 11, front: "What is a metaclass?", back: "A class whose instances are classes. The 'type' is the default metaclass. Used for creating class factories and adding behavior to class creation.", topic: "Advanced Python", difficulty: "Expert" },
{ id: 12, front: "What is CAP theorem?", back: "In distributed systems, you can only guarantee 2 of 3: Consistency, Availability, Partition Tolerance.", topic: "System Design", difficulty: "Expert" },
{ id: 13, front: "What is CI/CD?", back: "Continuous Integration: Auto-merge and test code. Continuous Delivery/Deployment: Auto-deploy to staging/production after tests pass.", topic: "DevOps", difficulty: "Medium" },
{ id: 14, front: "What is a closure?", back: "A function that captures variables from its enclosing scope, even after the outer function returns. Used in decorators and callbacks.", topic: "Advanced Python", difficulty: "Medium" },
{ id: 15, front: "What is Kubernetes?", back: "Container orchestration platform. Manages deployment, scaling, and operation of containerized applications across clusters of machines.", topic: "DevOps", difficulty: "Hard" }
];
// ============================================================
// INTERVIEW QUESTIONS DATA
// ============================================================
const INTERVIEW_DATA = {
python: [
{ q: "Explain the difference between deep copy and shallow copy.", a: "Shallow copy creates a new object but references the same nested objects. Deep copy creates a completely independent copy including all nested objects. Use copy.deepcopy() for deep copy.", difficulty: "Medium" },
{ q: "What is the difference between __str__ and __repr__?", a: "__str__ is for end-user readable output (used by print). __repr__ is for developer debugging (used in REPL). If only one defined, __repr__ is used as fallback.", difficulty: "Medium" },
{ q: "Explain Python's memory management.", a: "Python uses reference counting + garbage collection. When reference count drops to 0, object is deallocated. GC handles circular references. Use sys.getrefcount() to see counts.", difficulty: "Hard" },
{ q: "What are Python's built-in design patterns?", a: "Singleton (modules), Iterator (generators), Observer (signals), Decorator (@decorator), Strategy (first-class functions), Factory (classmethod).", difficulty: "Hard" },
{ q: "How does the Python import system work?", a: "Python searches sys.path (current dir, PYTHONPATH, installation dirs). First import runs module code and caches in sys.modules. Subsequent imports use cache.", difficulty: "Medium" }
],
system_design: [
{ q: "Design a URL shortener like bit.ly", a: "Components: API server, base62 encoding, database (key-value), cache (Redis), CDN. Handle: collisions, expiry, analytics, rate limiting, high availability.", difficulty: "Hard" },
{ q: "Design a rate limiter", a: "Algorithms: Token Bucket (smooth), Leaky Bucket (queue), Fixed Window, Sliding Window. Store counts in Redis with TTL. Distributed using Redis atomic operations.", difficulty: "Hard" },
{ q: "How would you scale a database?", a: "Vertical scaling (bigger server), horizontal scaling (sharding), read replicas, caching (Redis/Memcached), connection pooling, query optimization, indexes.", difficulty: "Expert" }
],
behavioral: [
{ q: "Tell me about a time you debugged a difficult bug.", a: "Use STAR: Situation (production crash), Task (find root cause), Action (added logging, bisected commits, reproduced locally), Result (fixed race condition, added tests).", difficulty: "Medium" },
{ q: "How do you stay updated with Python developments?", a: "Follow Python blog, PEPs, Real Python, GitHub trending, Twitter/X developers, Python Weekly newsletter, conferences (PyCon), open source contributions.", difficulty: "Easy" },
{ q: "Describe your approach to code review.", a: "Look for: correctness, readability, performance, security, test coverage, documentation. Give constructive feedback. Ask questions not commands. Approve when good enough, not perfect.", difficulty: "Medium" }
]
};
// ============================================================
// CHEAT SHEETS DATA
// ============================================================
const CHEATSHEETS_DATA = {
python: {
title: "Python Quick Reference",
sections: [
{
title: "Data Types",
items: [
{ code: "int, float, complex", desc: "Numeric types" },
{ code: "str", desc: "Immutable text sequence" },
{ code: "list = []", desc: "Mutable ordered sequence" },
{ code: "tuple = ()", desc: "Immutable ordered sequence" },
{ code: "dict = {}", desc: "Key-value mapping" },
{ code: "set = set()", desc: "Unordered unique elements" },
{ code: "bool: True/False", desc: "Boolean type" },
{ code: "None", desc: "Null value" }
]
},
{
title: "String Methods",
items: [
{ code: "s.upper() / s.lower()", desc: "Case conversion" },
{ code: "s.strip()", desc: "Remove whitespace" },
{ code: "s.split(sep)", desc: "Split into list" },
{ code: "sep.join(lst)", desc: "Join list into string" },
{ code: "s.replace(old, new)", desc: "Replace substring" },
{ code: "s.startswith(prefix)", desc: "Check prefix" },
{ code: "s.find(sub)", desc: "Find index (-1 if not found)" },
{ code: "f'{var}'", desc: "f-string formatting" }
]
}
]
},
git: {
title: "Git Commands",
sections: [
{
title: "Essential Commands",
items: [
{ code: "git init", desc: "Initialize repo" },
{ code: "git clone <url>", desc: "Clone remote repo" },
{ code: "git add .", desc: "Stage all changes" },
{ code: "git commit -m 'msg'", desc: "Commit staged changes" },
{ code: "git push origin main", desc: "Push to remote" },
{ code: "git pull origin main", desc: "Pull from remote" },
{ code: "git status", desc: "Check working tree status" },
{ code: "git log --oneline", desc: "View commit history" }
]
},
{
title: "Branching",
items: [
{ code: "git branch", desc: "List branches" },
{ code: "git checkout -b feature", desc: "Create & switch branch" },
{ code: "git merge feature", desc: "Merge branch" },
{ code: "git rebase main", desc: "Rebase onto main" },
{ code: "git stash", desc: "Stash changes" },
{ code: "git stash pop", desc: "Apply stash" }
]
}
]
}
};
// ============================================================
// MOTIVATIONAL QUOTES
// ============================================================
const QUOTES = [
{ text: "The only way to learn a new programming language is by writing programs in it.", author: "Dennis Ritchie" },
{ text: "Code is like humor. When you have to explain it, it's bad.", author: "Cory House" },
{ text: "First, solve the problem. Then, write the code.", author: "John Johnson" },
{ text: "Programming is not about typing, it's about thinking.", author: "Rich Hickey" },
{ text: "The best error message is the one that never shows up.", author: "Thomas Fuchs" },
{ text: "Make it work, make it right, make it fast.", author: "Kent Beck" },
{ text: "Good code is its own best documentation.", author: "Steve McConnell" },
{ text: "Simplicity is the soul of efficiency.", author: "Austin Freeman" },
{ text: "Every great developer you know got there by solving problems they were unqualified to solve.", author: "Patrick McKenzie" },
{ text: "Talk is cheap. Show me the code.", author: "Linus Torvalds" },
{ text: "The most important property of a program is whether it accomplishes the intention of its user.", author: "C.A.R. Hoare" },
{ text: "Debugging is twice as hard as writing the code in the first place.", author: "Brian Kernighan" },
{ text: "Programs must be written for people to read, and only incidentally for machines to execute.", author: "Harold Abelson" },
{ text: "The function of good software is to make the complex appear to be simple.", author: "Grady Booch" },
{ text: "Python is an experiment in how much freedom programmers need.", author: "Guido van Rossum" }
];
// ============================================================
// ACHIEVEMENTS DATA
// ============================================================
const ACHIEVEMENTS = [
{ id: "first_lesson", title: "First Steps", description: "Complete your first lesson", icon: "🎯", xp: 50 },
{ id: "week_streak", title: "Week Warrior", description: "7-day learning streak", icon: "🔥", xp: 200 },
{ id: "phase1_complete", title: "Python Initiate", description: "Complete Phase 1", icon: "🐍", xp: 500 },
{ id: "phase5_complete", title: "OOP Master", description: "Complete OOP phase", icon: "🏛️", xp: 1000 },
{ id: "quiz_perfect", title: "Quiz Ace", description: "100% on any quiz", icon: "💯", xp: 300 },
{ id: "projects_10", title: "Builder", description: "Complete 10 projects", icon: "🔨", xp: 1000 },
{ id: "flashcards_50", title: "Memory Master", description: "Review 50 flashcards", icon: "🧠", xp: 500 },
{ id: "daily_30", title: "Monthly Champion", description: "30-day streak", icon: "🏆", xp: 2000 },
{ id: "all_phases", title: "Python Expert", description: "Complete all phases", icon: "👑", xp: 10000 },
{ id: "notes_10", title: "Note Taker", description: "Write 10 notes", icon: "📝", xp: 200 }
];
// Export for use in other files
if (typeof module !== 'undefined') {
module.exports = { ROADMAP_DATA, PROJECTS_DATA, DAILY_CHALLENGES, QUIZ_DATA, FLASHCARDS_DATA, INTERVIEW_DATA, CHEATSHEETS_DATA, QUOTES, ACHIEVEMENTS };
}