diff --git a/week 1/day 2/exo2.py b/week 1/day 2/exo2.py index e69de29..f5f96ae 100644 --- a/week 1/day 2/exo2.py +++ b/week 1/day 2/exo2.py @@ -0,0 +1,8 @@ +stringSubmit = input("give me a string: ") +numberOfChar = 0 + +for ch in stringSubmit: + if 'a' <= ch <= 'z' or 'A' <= ch <= 'Z': + numberOfChar+=1 + +print("your string contain " + str(numberOfChar) + " characters") \ No newline at end of file diff --git a/week 1/day 2/exo4.py b/week 1/day 2/exo4.py new file mode 100644 index 0000000..ad1ab7a --- /dev/null +++ b/week 1/day 2/exo4.py @@ -0,0 +1,15 @@ +users = ["admin", "root1", "John_Doe", "Alice", "Bob42"] + +badChar=False + +for user in users: + for ch in user: + if ('a' <= ch <='z') or ('A' <= ch <='Z') or ch == ' ': + badChar=False + else: + badChar=True + break + if badChar == False and len(user) <= 20: + print(user + " is Valid") + else: + print(user + " Error contain special character, space or digit !") diff --git a/week 1/day 2/exo5.md b/week 1/day 2/exo5.md new file mode 100644 index 0000000..e69de29 diff --git a/week 1/day 2/update.md b/week 1/day 2/update.md new file mode 100644 index 0000000..7c49763 --- /dev/null +++ b/week 1/day 2/update.md @@ -0,0 +1,79 @@ +# Full Customized Progress Map + +**Status:** 28% complete — Week 1 Day 2 finished 🚀 + +## Student Profile + +* **Background:** Experienced Full-Stack Web Developer (JavaScript, PHP, SQL, HTML, CSS, Python) +* **Primary Goals:** System Administration, Security, Algorithms & Low-Level Programming +* **Cert Path:** CompTIA A+ → CCNA → Security+ +* **Learning Style:** Project-based, hands-on, practical labs +* **Setup:** Linux host + Windows VM, VS Code with extensions installed + +--- + +## Week 1 Progress + +### Day 1: Variables, Types & Algorithm Foundations + +**Languages Covered:** C, Python, Bash, PowerShell (conceptual C++, C#, SQL comparisons) + +**Mini-Project:** Cross-Platform System Information CLI / Input Validation CLI + +**Exercises:** + +* Hello Name Input +* Character Counting +* Length Validation +* First Character Validation +* Full Input Sanitization + +### Day 2: Conditionals & Loops in Python + +**Languages Covered:** Python 3.12 + +**Concepts Learned:** + +* Translating C-style algorithms into Python +* `if`, `elif`, `else` conditional structures +* Boolean operators: `and`, `or`, `not` +* Looping over strings and collections (`for ch in string`, `for user in list`) +* Input validation across multiple items +* Early exit with `break` for efficiency +* Algorithmic thinking in Python: character counting, validation, and loop analysis +* Time complexity: T(n) for loops, T(m, n) for nested loops +* Security-aware practices (ASCII checks vs `isalpha()`, defensive coding for empty input) + +**Exercises Completed:** + +1. Even/Odd number checker +2. Count letters in a string +3. Rebuild C username validator in Python +4. Validate list of usernames +5. Algorithm runtime analysis (linear scaling, T(m, n) = m × n) + +**Key Learnings / Memories:** + +* Python hides memory details, but algorithmic logic is the same +* Conditional logic and loop behavior mirrors C, reinforcing Day 1 concepts +* Defensive coding is critical for sysadmin/security tasks +* Linear time complexity in loops and nested loops is fundamental to performance and security analysis +* Security insight: validation must be explicit to avoid Unicode or special-character pitfalls + +**Next Objectives:** + +* Week 1 Day 3: SQL — conditional queries, filtering, and algorithmic thinking + + * Apply conditional logic in database queries + * Compare SQL filtering with procedural languages + * Analyze query runtime in a similar T(n) mindset + +**Practice Recommendations:** + +* Reimplement Day 1 and Day 2 validation logic in Bash and PowerShell for cross-platform practice +* Explore Python built-ins (`isalpha()`, `isdigit()`) and compare with ASCII-based logic +* Start thinking about applying loops and conditionals to database queries in SQL + +--- + +**Status Update:** Day 2 completed, ready to move to Day 3 (SQL — conditionals & filtering)