Skip to content

Commit 8865cce

Browse files
updatd
1 parent c1b6416 commit 8865cce

64 files changed

Lines changed: 2264 additions & 1303 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

10-logical-operators/10-logical-operators.ipynb

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,22 @@
1313
"source": [
1414
"# Chapter 11: Logical Operators\n",
1515
"\n",
16-
"## 📺 Video Tutorial\n",
16+
"## \ud83d\udcfa Video Tutorial\n",
1717
"\n",
1818
"[![Watch on YouTube](https://img.shields.io/badge/Watch-YouTube-red?style=for-the-badge&logo=youtube)](https://youtu.be/W7luvtXeQTA)\n",
1919
"\n",
20-
"**Logical operators in Python are easy 🔣** (7:56)\n",
20+
"**Logical operators in Python are easy \ud83d\udd23** (7:56)\n",
2121
"\n",
22-
"## 📺 Video Tutorial\n",
23-
"\n",
24-
"[![Watch on YouTube](https://img.shields.io/badge/Watch-YouTube-red?style=for-the-badge&logo=youtube)](https://youtu.be/W7luvtXeQTA)\n",
25-
"\n",
26-
"## 📚 What You'll Learn\n",
22+
"## \ud83d\udcda What You'll Learn\n",
2723
"Combine multiple conditions using logical operators to create powerful decision-making logic!\n",
2824
"\n",
29-
"## 🎯 Learning Objectives\n",
25+
"## \ud83c\udfaf Learning Objectives\n",
3026
"- Understand AND, OR, and NOT logical operators\n",
3127
"- Combine multiple conditions in if statements\n",
3228
"- Create complex decision-making logic\n",
3329
"- Use truth tables to understand operator behavior\n",
3430
"\n",
35-
"## 📖 Concept Explanation\n",
31+
"## \ud83d\udcd6 Concept Explanation\n",
3632
"\n",
3733
"### Logical Operators\n",
3834
"Logical operators combine boolean expressions (conditions) to create more complex logic.\n",
@@ -86,7 +82,7 @@
8682
"| True | False |\n",
8783
"| False | True |\n",
8884
"\n",
89-
"## 💡 Examples\n",
85+
"## \ud83d\udca1 Examples\n",
9086
"\n",
9187
"### Example 1: Age and License Check\n",
9288
"```python\n",
@@ -132,7 +128,7 @@
132128
" print(\"Access denied!\")\n",
133129
"```\n",
134130
"\n",
135-
"## ✍️ Practice Exercises\n",
131+
"## \u270d\ufe0f Practice Exercises\n",
136132
"\n",
137133
"1. **Voting Eligibility**: Check if person can vote (age >= 18 AND is_citizen)\n",
138134
"2. **Discount Calculator**: Apply discount if purchase > $100 OR is_member\n",
@@ -141,7 +137,7 @@
141137
"5. **Weather Outfit**: Suggest outfit based on temp AND (is_raining OR is_snowing)\n",
142138
"6. **Access Control**: Grant access if (is_admin OR is_manager) AND is_active\n",
143139
"\n",
144-
"## 🔍 Common Mistakes\n",
140+
"## \ud83d\udd0d Common Mistakes\n",
145141
"\n",
146142
"### Mistake 1: Confusing AND with OR\n",
147143
"```python\n",
@@ -172,7 +168,7 @@
172168
"if username == \"admin\": # Comparison\n",
173169
"```\n",
174170
"\n",
175-
"## 📝 Operator Precedence\n",
171+
"## \ud83d\udcdd Operator Precedence\n",
176172
"Python evaluates operators in this order:\n",
177173
"1. Parentheses `()`\n",
178174
"2. `not`\n",
@@ -188,7 +184,7 @@
188184
"result = (True or False) and False # False\n",
189185
"```\n",
190186
"\n",
191-
"## 🎮 Real-World Examples\n",
187+
"## \ud83c\udfae Real-World Examples\n",
192188
"\n",
193189
"### Example: E-commerce Discount\n",
194190
"```python\n",
@@ -213,27 +209,27 @@
213209
"has_motion = False\n",
214210
"\n",
215211
"if is_armed and (is_door_open or (is_night and has_motion)):\n",
216-
" print(\"🚨 ALERT! Intrusion detected!\")\n",
212+
" print(\"\ud83d\udea8 ALERT! Intrusion detected!\")\n",
217213
"else:\n",
218-
" print(\" System normal\")\n",
214+
" print(\"\u2713 System normal\")\n",
219215
"```\n",
220216
"\n",
221-
"## 🚀 Challenge Projects\n",
217+
"## \ud83d\ude80 Challenge Projects\n",
222218
"\n",
223219
"1. **Smart Thermostat**: Turn on AC if (temp > 75 and is_home) or override_on\n",
224220
"2. **Library Fine Calculator**: Fine if overdue AND (not is_student OR days > 7)\n",
225221
"3. **Flight Booking**: Available if (seats > 0) and (has_passport or is_domestic)\n",
226222
"4. **Game Level Unlock**: Unlock if (score >= 1000 and level >= 5) or has_premium\n",
227223
"\n",
228-
"## 🎓 Key Takeaways from Video\n",
224+
"## \ud83c\udf93 Key Takeaways from Video\n",
229225
"\n",
230226
"1. Conditionals execute code based on conditions\n",
231227
"2. Use if-elif-else for conditional logic\n",
232228
"3. Follow along with the video for hands-on practice\n",
233229
"\n",
234-
"> 💡 *These points cover the main concepts from the video tutorial to help reinforce your learning.*\n",
230+
"> \ud83d\udca1 *These points cover the main concepts from the video tutorial to help reinforce your learning.*\n",
235231
"\n",
236-
"## 🔗 Next Chapter\n",
232+
"## \ud83d\udd17 Next Chapter\n",
237233
"Continue to [Chapter 12: Conditional Expressions](../12-conditional/) to learn shorthand if-else statements!\n",
238234
"\n",
239235
""
@@ -288,9 +284,9 @@
288284
"# ============================================\n",
289285
"# Logical Operators Summary:\n",
290286
"# ============================================\n",
291-
"# and Both conditions must be True\n",
292-
"# or At least one condition must be True\n",
293-
"# not Reverses the boolean value"
287+
"# and \u2192 Both conditions must be True\n",
288+
"# or \u2192 At least one condition must be True\n",
289+
"# not \u2192 Reverses the boolean value"
294290
]
295291
}
296292
],

11-conditional-expressions/11-conditional-expressions.ipynb

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,22 @@
1313
"source": [
1414
"# Chapter 12: Conditional Expressions (Ternary Operator)\n",
1515
"\n",
16-
"## 📺 Video Tutorial\n",
16+
"## \ud83d\udcfa Video Tutorial\n",
1717
"\n",
1818
"[![Watch on YouTube](https://img.shields.io/badge/Watch-YouTube-red?style=for-the-badge&logo=youtube)](https://youtu.be/TYyKQBC4bwE)\n",
1919
"\n",
20-
"**Learn conditional expressions in 5 minutes! ** (5:21)\n",
20+
"**Learn conditional expressions in 5 minutes! \u2753** (5:21)\n",
2121
"\n",
22-
"## 📺 Video Tutorial\n",
23-
"\n",
24-
"[![Watch on YouTube](https://img.shields.io/badge/Watch-YouTube-red?style=for-the-badge&logo=youtube)](https://youtu.be/TYyKQBC4bwE)\n",
25-
"\n",
26-
"## 📚 What You'll Learn\n",
22+
"## \ud83d\udcda What You'll Learn\n",
2723
"Write compact, elegant one-line conditional statements using Python's ternary operator!\n",
2824
"\n",
29-
"## 🎯 Learning Objectives\n",
25+
"## \ud83c\udfaf Learning Objectives\n",
3026
"- Understand the ternary operator syntax\n",
3127
"- Convert if-else statements to one-liners\n",
3228
"- Know when to use ternary vs traditional if-else\n",
3329
"- Write cleaner, more pythonic code\n",
3430
"\n",
35-
"## 📖 Concept Explanation\n",
31+
"## \ud83d\udcd6 Concept Explanation\n",
3632
"\n",
3733
"### What is a Ternary Operator?\n",
3834
"A ternary operator (conditional expression) is a compact way to write simple if-else statements in one line.\n",
@@ -54,7 +50,7 @@
5450
"status = \"Adult\" if age >= 18 else \"Minor\"\n",
5551
"```\n",
5652
"\n",
57-
"## 💡 Examples\n",
53+
"## \ud83d\udca1 Examples\n",
5854
"\n",
5955
"### Example 1: Even or Odd\n",
6056
"```python\n",
@@ -84,7 +80,7 @@
8480
"print(access) # Output: Full Access\n",
8581
"```\n",
8682
"\n",
87-
"## ✍️ Practice Exercises\n",
83+
"## \u270d\ufe0f Practice Exercises\n",
8884
"\n",
8985
"1. Check if number is positive, negative, or zero\n",
9086
"2. Determine if year is leap year (divisible by 4)\n",
@@ -93,9 +89,9 @@
9389
"5. Determine shipping: \"Free\" if total > 50 else \"$5.99\"\n",
9490
"6. Set temperature message: \"Cold\" if temp < 60 else \"Warm\"\n",
9591
"\n",
96-
"## 🔍 When to Use\n",
92+
"## \ud83d\udd0d When to Use\n",
9793
"\n",
98-
"### Good Use Cases\n",
94+
"### \u2705 Good Use Cases\n",
9995
"```python\n",
10096
"# Simple value assignment\n",
10197
"status = \"Open\" if is_open else \"Closed\"\n",
@@ -110,7 +106,7 @@
110106
"return True if value > 0 else False\n",
111107
"```\n",
112108
"\n",
113-
"### Avoid Ternary For\n",
109+
"### \u274c Avoid Ternary For\n",
114110
"```python\n",
115111
"# Complex logic (use regular if-else)\n",
116112
"result = \"A\" if score >= 90 else \"B\" if score >= 80 else \"C\" if score >= 70 else \"F\"\n",
@@ -121,7 +117,7 @@
121117
"# Not allowed - ternary is for expressions, not statements\n",
122118
"```\n",
123119
"\n",
124-
"## 📝 Nested Ternary (Use Sparingly!)\n",
120+
"## \ud83d\udcdd Nested Ternary (Use Sparingly!)\n",
125121
"```python\n",
126122
"# Can be hard to read\n",
127123
"grade = \"A\" if score >= 90 else \"B\" if score >= 80 else \"C\" if score >= 70 else \"F\"\n",
@@ -137,7 +133,7 @@
137133
" grade = \"F\"\n",
138134
"```\n",
139135
"\n",
140-
"## 🎮 Real-World Examples\n",
136+
"## \ud83c\udfae Real-World Examples\n",
141137
"\n",
142138
"### Example: Discount Calculator\n",
143139
"```python\n",
@@ -151,26 +147,26 @@
151147
"### Example: User Status Badge\n",
152148
"```python\n",
153149
"points = 1500\n",
154-
"badge = \"🥇 Gold\" if points >= 1000 else \"🥈 Silver\" if points >= 500 else \"🥉 Bronze\"\n",
150+
"badge = \"\ud83e\udd47 Gold\" if points >= 1000 else \"\ud83e\udd48 Silver\" if points >= 500 else \"\ud83e\udd49 Bronze\"\n",
155151
"print(f\"Your badge: {badge}\")\n",
156152
"```\n",
157153
"\n",
158-
"## 🚀 Try It Yourself\n",
154+
"## \ud83d\ude80 Try It Yourself\n",
159155
"1. Create age category checker (Child/Teen/Adult/Senior)\n",
160156
"2. Build temperature converter with unit check\n",
161157
"3. Make a simple calculator using ternary for operation selection\n",
162158
"4. Create BMI category determiner\n",
163159
"5. Build a simple voting eligibility checker\n",
164160
"\n",
165-
"## 🎓 Key Takeaways from Video\n",
161+
"## \ud83c\udf93 Key Takeaways from Video\n",
166162
"\n",
167163
"1. Variables store data values that can be reused\n",
168164
"2. Use if-elif-else for conditional logic\n",
169165
"3. Follow along with the video for hands-on practice\n",
170166
"\n",
171-
"> 💡 *These points cover the main concepts from the video tutorial to help reinforce your learning.*\n",
167+
"> \ud83d\udca1 *These points cover the main concepts from the video tutorial to help reinforce your learning.*\n",
172168
"\n",
173-
"## 🔗 Next Chapter\n",
169+
"## \ud83d\udd17 Next Chapter\n",
174170
"Continue to [Chapter 13: String Methods](../13-string/) to explore string manipulation techniques!\n",
175171
"\n",
176172
""
@@ -240,10 +236,10 @@
240236
"# ============================================\n",
241237
"# When to use Conditional Expressions:\n",
242238
"# ============================================\n",
243-
"# Simple conditions with single-line results\n",
244-
"# Variable assignments based on conditions\n",
245-
"# When you want concise, readable code\n",
246-
"# Complex conditions (use regular if-else instead)"
239+
"# \u2713 Simple conditions with single-line results\n",
240+
"# \u2713 Variable assignments based on conditions\n",
241+
"# \u2713 When you want concise, readable code\n",
242+
"# \u2717 Complex conditions (use regular if-else instead)"
247243
]
248244
}
249245
],

12-string-methods/12-string-methods.ipynb

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,45 +13,41 @@
1313
"source": [
1414
"# Chapter 13: String Methods\n",
1515
"\n",
16-
"## 📺 Video Tutorial\n",
16+
"## \ud83d\udcfa Video Tutorial\n",
1717
"\n",
1818
"[![Watch on YouTube](https://img.shields.io/badge/Watch-YouTube-red?style=for-the-badge&logo=youtube)](https://youtu.be/tb6EYiHtcXU)\n",
1919
"\n",
20-
"**String methods in Python are easy! 〰️** (12:14)\n",
20+
"**String methods in Python are easy! \u3030\ufe0f** (12:14)\n",
2121
"\n",
22-
"## 📺 Video Tutorial\n",
23-
"\n",
24-
"[![Watch on YouTube](https://img.shields.io/badge/Watch-YouTube-red?style=for-the-badge&logo=youtube)](https://youtu.be/tb6EYiHtcXU)\n",
25-
"\n",
26-
"## 📚 What You'll Learn\n",
22+
"## \ud83d\udcda What You'll Learn\n",
2723
"Master Python's powerful string manipulation methods to transform and analyze text!\n",
2824
"\n",
29-
"## 🎯 Learning Objectives\n",
25+
"## \ud83c\udfaf Learning Objectives\n",
3026
"- Use common string methods (.upper(), .lower(), .title(), etc.)\n",
3127
"- Find and replace substrings\n",
3228
"- Validate string content\n",
3329
"- Combine multiple string operations\n",
3430
"\n",
35-
"## 📖 Concept Explanation\n",
31+
"## \ud83d\udcd6 Concept Explanation\n",
3632
"\n",
3733
"Strings in Python come with many built-in methods for manipulation. Methods are functions that belong to an object (in this case, strings).\n",
3834
"\n",
3935
"### Common String Methods\n",
4036
"\n",
4137
"| Method | Description | Example |\n",
4238
"|--------|-------------|---------|\n",
43-
"| `.upper()` | Convert to uppercase | `\"hello\".upper()` `\"HELLO\"` |\n",
44-
"| `.lower()` | Convert to lowercase | `\"HELLO\".lower()` `\"hello\"` |\n",
45-
"| `.title()` | Capitalize first letter of each word | `\"hello world\".title()` `\"Hello World\"` |\n",
46-
"| `.capitalize()` | Capitalize first letter only | `\"hello world\".capitalize()` `\"Hello world\"` |\n",
47-
"| `.find()` | Find substring index | `\"hello\".find(\"e\")` `1` |\n",
48-
"| `.replace()` | Replace substring | `\"hello\".replace(\"l\", \"L\")` `\"heLLo\"` |\n",
49-
"| `.isdigit()` | Check if all digits | `\"123\".isdigit()` `True` |\n",
50-
"| `.isalpha()` | Check if all letters | `\"abc\".isalpha()` `True\"` |\n",
51-
"| `.strip()` | Remove whitespace | `\" hi \".strip()` `\"hi\"` |\n",
52-
"| `.split()` | Split into list | `\"a,b,c\".split(\",\")` `['a','b','c']` |\n",
53-
"\n",
54-
"## 💡 Examples\n",
39+
"| `.upper()` | Convert to uppercase | `\"hello\".upper()` \u2192 `\"HELLO\"` |\n",
40+
"| `.lower()` | Convert to lowercase | `\"HELLO\".lower()` \u2192 `\"hello\"` |\n",
41+
"| `.title()` | Capitalize first letter of each word | `\"hello world\".title()` \u2192 `\"Hello World\"` |\n",
42+
"| `.capitalize()` | Capitalize first letter only | `\"hello world\".capitalize()` \u2192 `\"Hello world\"` |\n",
43+
"| `.find()` | Find substring index | `\"hello\".find(\"e\")` \u2192 `1` |\n",
44+
"| `.replace()` | Replace substring | `\"hello\".replace(\"l\", \"L\")` \u2192 `\"heLLo\"` |\n",
45+
"| `.isdigit()` | Check if all digits | `\"123\".isdigit()` \u2192 `True` |\n",
46+
"| `.isalpha()` | Check if all letters | `\"abc\".isalpha()` \u2192 `True\"` |\n",
47+
"| `.strip()` | Remove whitespace | `\" hi \".strip()` \u2192 `\"hi\"` |\n",
48+
"| `.split()` | Split into list | `\"a,b,c\".split(\",\")` \u2192 `['a','b','c']` |\n",
49+
"\n",
50+
"## \ud83d\udca1 Examples\n",
5551
"\n",
5652
"### Example 1: Case Conversion\n",
5753
"```python\n",
@@ -91,7 +87,7 @@
9187
" print(\"Please enter only digits\")\n",
9288
"```\n",
9389
"\n",
94-
"## ✍️ Practice Exercises\n",
90+
"## \u270d\ufe0f Practice Exercises\n",
9591
"\n",
9692
"1. Create a program that converts usernames to lowercase\n",
9793
"2. Clean phone numbers by removing spaces and dashes\n",
@@ -100,7 +96,7 @@
10096
"5. Create a function that capitalizes names properly\n",
10197
"6. Build a simple text processor that removes extra spaces\n",
10298
"\n",
103-
"## 📝 More Useful Methods\n",
99+
"## \ud83d\udcdd More Useful Methods\n",
104100
"\n",
105101
"### `.count(substring)`\n",
106102
"```python\n",
@@ -134,7 +130,7 @@
134130
"csv = \",\".join(words) # \"Python,is,awesome\"\n",
135131
"```\n",
136132
"\n",
137-
"## 🎮 Real-World Examples\n",
133+
"## \ud83c\udfae Real-World Examples\n",
138134
"\n",
139135
"### Email Validator\n",
140136
"```python\n",
@@ -166,23 +162,23 @@
166162
" print(\"Weak password\")\n",
167163
"```\n",
168164
"\n",
169-
"## 🚀 Challenge Projects\n",
165+
"## \ud83d\ude80 Challenge Projects\n",
170166
"\n",
171167
"1. **Text Analyzer**: Count words, letters, vowels, consonants\n",
172168
"2. **Name Formatter**: Handle various name formats (JOHN DOE, john doe, etc.)\n",
173169
"3. **Censorship Filter**: Replace bad words with asterisks\n",
174-
"4. **Acronym Generator**: Create acronyms from phrases (e.g., \"For Your Information\" \"FYI\")\n",
170+
"4. **Acronym Generator**: Create acronyms from phrases (e.g., \"For Your Information\" \u2192 \"FYI\")\n",
175171
"5. **Text Reverser**: Reverse words and sentences in different ways\n",
176172
"\n",
177-
"## 🎓 Key Takeaways from Video\n",
173+
"## \ud83c\udf93 Key Takeaways from Video\n",
178174
"\n",
179175
"1. Strings are text data enclosed in quotes\n",
180176
"2. Define functions using the def keyword\n",
181177
"3. Use if-elif-else for conditional logic\n",
182178
"\n",
183-
"> 💡 *These points cover the main concepts from the video tutorial to help reinforce your learning.*\n",
179+
"> \ud83d\udca1 *These points cover the main concepts from the video tutorial to help reinforce your learning.*\n",
184180
"\n",
185-
"## 🔗 Next Chapter\n",
181+
"## \ud83d\udd17 Next Chapter\n",
186182
"Continue to [Chapter 14: Indexing](../14-index/) to learn how to access individual characters!\n",
187183
"\n",
188184
""

0 commit comments

Comments
 (0)