|
| 1 | +# 🐛 Bug Fixes Needed |
| 2 | + |
| 3 | +Critical and important bugs that need fixing. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## 🔴 Critical Bugs (Fix Immediately) |
| 8 | + |
| 9 | +### #BUG001 - Prime Checker Has Logic Error |
| 10 | +**Severity:** 🔴 Critical |
| 11 | +**File:** `basics/03_control_flow/02_check_prime.py` |
| 12 | +**Difficulty:** ⭐ Easy |
| 13 | + |
| 14 | +**Problem:** |
| 15 | +The prime number checker returns incorrect results - it says prime numbers are not prime and vice versa. |
| 16 | + |
| 17 | +**Current behavior:** |
| 18 | +```python |
| 19 | +# Lines 13-16 have inverted logic |
| 20 | +if(prime): |
| 21 | + prime = False # Bug! This makes primes return False |
| 22 | +else: |
| 23 | + prime = True # Bug! This makes non-primes return True |
| 24 | +``` |
| 25 | + |
| 26 | +**Expected behavior:** |
| 27 | +- `is_prime(7)` should return `True` |
| 28 | +- `is_prime(10)` should return `False` |
| 29 | + |
| 30 | +**Fix:** |
| 31 | +Remove lines 13-16 entirely. The logic before this already correctly sets the `prime` variable. |
| 32 | + |
| 33 | +**Acceptance criteria:** |
| 34 | +- [ ] Remove inverted logic block |
| 35 | +- [ ] Test with primes: 2, 3, 5, 7, 11 → should return `True` |
| 36 | +- [ ] Test with non-primes: 4, 6, 8, 9, 10 → should return `False` |
| 37 | +- [ ] Test edge cases: 0, 1, negative → should return `False` |
| 38 | + |
| 39 | +--- |
| 40 | + |
| 41 | +### #BUG002 - Function Named 'sum' Performs Division |
| 42 | +**Severity:** 🔴 Critical |
| 43 | +**File:** `basics/09_error_handling/01_try_except.py` |
| 44 | +**Difficulty:** ⭐ Easy |
| 45 | + |
| 46 | +**Problem:** |
| 47 | +Function named `sum` actually performs division, which is misleading and confusing. |
| 48 | + |
| 49 | +**Current code:** |
| 50 | +```python |
| 51 | +def sum(a: int, b: int) -> int: # Name suggests addition |
| 52 | + result = a / b # But performs division! |
| 53 | + return result |
| 54 | +``` |
| 55 | + |
| 56 | +**Fix:** |
| 57 | +Rename function to `divide` and update return type to `float`. |
| 58 | + |
| 59 | +**Acceptance criteria:** |
| 60 | +- [ ] Rename function from `sum` to `divide` |
| 61 | +- [ ] Update return type hint to `float` |
| 62 | +- [ ] Update all function calls |
| 63 | +- [ ] Add docstring |
| 64 | + |
| 65 | +--- |
| 66 | + |
| 67 | +### #BUG003 - Guess Number Game Crashes on Invalid Input |
| 68 | +**Severity:** 🔴 Critical |
| 69 | +**File:** `basics/11_projects/01_guess_number.py` |
| 70 | +**Difficulty:** ⭐⭐ Easy-Medium |
| 71 | + |
| 72 | +**Problem:** |
| 73 | +Game crashes when user enters non-integer input. |
| 74 | + |
| 75 | +**Current code:** |
| 76 | +```python |
| 77 | +user_input = int(input(f"Guess the Number: ")) # Crashes on "abc" |
| 78 | +``` |
| 79 | + |
| 80 | +**Fix:** |
| 81 | +Add try/except block to handle `ValueError`. |
| 82 | + |
| 83 | +**Acceptance criteria:** |
| 84 | +- [ ] Catch `ValueError` around `int()` conversion |
| 85 | +- [ ] Display friendly error message |
| 86 | +- [ ] Allow user to try again without crashing |
| 87 | +- [ ] Test with: "abc", "12.5", "", special characters |
| 88 | + |
| 89 | +--- |
| 90 | + |
| 91 | +### #BUG004 - Rock Paper Scissors Crashes on Invalid Input |
| 92 | +**Severity:** 🔴 Critical |
| 93 | +**File:** `basics/11_projects/03_rock_paper_scissors.py` |
| 94 | +**Difficulty:** ⭐⭐ Easy-Medium |
| 95 | + |
| 96 | +**Problem:** |
| 97 | +Game doesn't validate input before using `.upper()` and crashes on invalid choices. |
| 98 | + |
| 99 | +**Fix:** |
| 100 | +Add input validation loop to ensure input is R, P, or S. |
| 101 | + |
| 102 | +**Acceptance criteria:** |
| 103 | +- [ ] Validate input is one of R, P, S |
| 104 | +- [ ] Loop until valid input received |
| 105 | +- [ ] Fix typo: "Wents" → "Went" |
| 106 | +- [ ] Add case-insensitive handling |
| 107 | + |
| 108 | +--- |
| 109 | + |
| 110 | +### #BUG005 - File Examples Reference Non-Existent Files |
| 111 | +**Severity:** 🔴 Critical |
| 112 | +**Files:** Multiple in `basics/07_file_handling/` |
| 113 | +**Difficulty:** ⭐⭐ Easy-Medium |
| 114 | + |
| 115 | +**Problem:** |
| 116 | +Examples reference files like `poems.txt`, `newfile.txt` without creating them first. |
| 117 | + |
| 118 | +**Affected files:** |
| 119 | +- `01_file_handling_basics.py` - `newfile.txt` |
| 120 | +- `07_file_find_word.py` - `poems.txt` |
| 121 | +- `11_file_copy.py` - `this.txt` |
| 122 | + |
| 123 | +**Fix:** |
| 124 | +Add file existence check and create sample files if missing. |
| 125 | + |
| 126 | +**Acceptance criteria:** |
| 127 | +- [ ] Add `os.path.exists()` checks before reading |
| 128 | +- [ ] Create sample files if they don't exist |
| 129 | +- [ ] Add comment explaining the check |
| 130 | +- [ ] Test on fresh clone (no existing files) |
| 131 | + |
| 132 | +--- |
| 133 | + |
| 134 | +## 🟡 High Priority Bugs |
| 135 | + |
| 136 | +### #BUG006 - Division by Zero in Average Calculation |
| 137 | +**Severity:** 🟡 High |
| 138 | +**File:** `basics/02_variables_types/02_average.py` |
| 139 | +**Difficulty:** ⭐ Easy |
| 140 | + |
| 141 | +**Problem:** |
| 142 | +No validation to prevent division by zero if user enters 0. |
| 143 | + |
| 144 | +**Fix:** |
| 145 | +Add check for zero before division. |
| 146 | + |
| 147 | +--- |
| 148 | + |
| 149 | +### #BUG007 - Infinite Loop in While Example |
| 150 | +**Severity:** 🟡 High |
| 151 | +**File:** `basics/03_control_flow/03_for_while_loops.py` |
| 152 | +**Difficulty:** ⭐ Easy |
| 153 | + |
| 154 | +**Problem:** |
| 155 | +One of the while loop examples doesn't increment counter, causing infinite loop. |
| 156 | + |
| 157 | +**Fix:** |
| 158 | +Ensure counter is incremented in all while loops. |
| 159 | + |
| 160 | +--- |
| 161 | + |
| 162 | +### #BUG008 - List Index Out of Range |
| 163 | +**Severity:** 🟡 High |
| 164 | +**File:** `basics/05_data_structures/02_list_fruits.py` |
| 165 | +**Difficulty:** ⭐ Easy |
| 166 | + |
| 167 | +**Problem:** |
| 168 | +Code tries to access list indices that don't exist if user enters fewer than 7 fruits. |
| 169 | + |
| 170 | +**Fix:** |
| 171 | +Add length check before accessing indices or use `.append()`. |
| 172 | + |
| 173 | +--- |
| 174 | + |
| 175 | +### #BUG009 - KeyError in Dictionary Example |
| 176 | +**Severity:** 🟡 High |
| 177 | +**File:** `basics/05_data_structures/16_dict_basics.py` |
| 178 | +**Difficulty:** ⭐ Easy |
| 179 | + |
| 180 | +**Problem:** |
| 181 | +Accessing dictionary key that doesn't exist without using `.get()`. |
| 182 | + |
| 183 | +**Fix:** |
| 184 | +Use `.get()` method or check key existence first. |
| 185 | + |
| 186 | +--- |
| 187 | + |
| 188 | +### #BUG010 - Type Error in String Concatenation |
| 189 | +**Severity:** 🟡 High |
| 190 | +**File:** `basics/06_strings/03_string_format.py` |
| 191 | +**Difficulty:** ⭐ Easy |
| 192 | + |
| 193 | +**Problem:** |
| 194 | +Trying to concatenate string with integer without conversion. |
| 195 | + |
| 196 | +**Fix:** |
| 197 | +Convert integers to strings with `str()`. |
| 198 | + |
| 199 | +--- |
| 200 | + |
| 201 | +## 🟢 Medium Priority Bugs |
| 202 | + |
| 203 | +### #BUG011 - Inconsistent Output Formatting |
| 204 | +**Severity:** 🟢 Medium |
| 205 | +**Files:** Multiple |
| 206 | +**Difficulty:** ⭐ Easy |
| 207 | + |
| 208 | +**Problem:** |
| 209 | +Output messages have inconsistent formatting (some with spaces, some without). |
| 210 | + |
| 211 | +**Fix:** |
| 212 | +Standardize output format across all examples. |
| 213 | + |
| 214 | +--- |
| 215 | + |
| 216 | +### #BUG012 - Missing Error Messages |
| 217 | +**Severity:** 🟢 Medium |
| 218 | +**Files:** `basics/09_error_handling/*.py` |
| 219 | +**Difficulty:** ⭐ Easy |
| 220 | + |
| 221 | +**Problem:** |
| 222 | +Some error handlers don't display helpful error messages. |
| 223 | + |
| 224 | +**Fix:** |
| 225 | +Add descriptive error messages to all exception handlers. |
| 226 | + |
| 227 | +--- |
| 228 | + |
| 229 | +### #BUG013 - Hardcoded File Paths |
| 230 | +**Severity:** 🟢 Medium |
| 231 | +**Files:** File handling examples |
| 232 | +**Difficulty:** ⭐⭐ Easy-Medium |
| 233 | + |
| 234 | +**Problem:** |
| 235 | +Some examples use absolute paths that won't work on other systems. |
| 236 | + |
| 237 | +**Fix:** |
| 238 | +Use relative paths or `pathlib.Path`. |
| 239 | + |
| 240 | +--- |
| 241 | + |
| 242 | +### #BUG014 - Magic Numbers in Code |
| 243 | +**Severity:** 🟢 Medium |
| 244 | +**Files:** Multiple |
| 245 | +**Difficulty:** ⭐ Easy |
| 246 | + |
| 247 | +**Problem:** |
| 248 | +Unexplained numbers like `0.5`, `100`, `1000` without context. |
| 249 | + |
| 250 | +**Fix:** |
| 251 | +Replace with named constants and add comments. |
| 252 | + |
| 253 | +--- |
| 254 | + |
| 255 | +### #BUG015 - Inconsistent Variable Naming |
| 256 | +**Severity:** 🟢 Medium |
| 257 | +**Files:** Multiple |
| 258 | +**Difficulty:** ⭐ Easy |
| 259 | + |
| 260 | +**Problem:** |
| 261 | +Some files use `camelCase`, others use `snake_case`. |
| 262 | + |
| 263 | +**Fix:** |
| 264 | +Standardize on `snake_case` per Python conventions. |
| 265 | + |
| 266 | +--- |
| 267 | + |
| 268 | +## 🔵 Low Priority Bugs |
| 269 | + |
| 270 | +### #BUG016 - Typos in Comments |
| 271 | +**Severity:** 🔵 Low |
| 272 | +**Files:** Multiple |
| 273 | +**Difficulty:** ⭐ Easy |
| 274 | + |
| 275 | +**Problem:** |
| 276 | +Spelling mistakes in code comments. |
| 277 | + |
| 278 | +**Fix:** |
| 279 | +Proofread and correct all comments. |
| 280 | + |
| 281 | +--- |
| 282 | + |
| 283 | +### #BUG017 - Outdated Examples |
| 284 | +**Severity:** 🔵 Low |
| 285 | +**Files:** `basics/10_advanced/` |
| 286 | +**Difficulty:** ⭐ Easy |
| 287 | + |
| 288 | +**Problem:** |
| 289 | +Some examples use outdated Python 2 syntax. |
| 290 | + |
| 291 | +**Fix:** |
| 292 | +Update to Python 3 syntax. |
| 293 | + |
| 294 | +--- |
| 295 | + |
| 296 | +### #BUG018 - Missing Period in Print Statements |
| 297 | +**Severity:** 🔵 Low |
| 298 | +**Files:** Multiple |
| 299 | +**Difficulty:** ⭐ Easy |
| 300 | + |
| 301 | +**Problem:** |
| 302 | +Some output messages don't end with periods. |
| 303 | + |
| 304 | +**Fix:** |
| 305 | +Add periods for consistency. |
| 306 | + |
| 307 | +--- |
| 308 | + |
| 309 | +## 📊 Bug Status |
| 310 | + |
| 311 | +| ID | Status | Assignee | PR | |
| 312 | +|----|--------|----------|-----| |
| 313 | +| #BUG001 | 🔴 Open | - | - | |
| 314 | +| #BUG002 | 🔴 Open | - | - | |
| 315 | +| #BUG003 | 🔴 Open | - | - | |
| 316 | +| #BUG004 | 🔴 Open | - | - | |
| 317 | +| #BUG005 | 🔴 Open | - | - | |
| 318 | +| #BUG006 | 🟡 Open | - | - | |
| 319 | +| #BUG007 | 🟡 Open | - | - | |
| 320 | +| #BUG008 | 🟡 Open | - | - | |
| 321 | +| #BUG009 | 🟡 Open | - | - | |
| 322 | +| #BUG010 | 🟡 Open | - | - | |
| 323 | + |
| 324 | +--- |
| 325 | + |
| 326 | +## 🐛 How to Report a Bug |
| 327 | + |
| 328 | +Found a bug not on this list? |
| 329 | + |
| 330 | +1. **Check existing issues** - It might already be reported |
| 331 | +2. **Open new issue** - Use bug report template |
| 332 | +3. **Include:** |
| 333 | + - File path |
| 334 | + - Expected behavior |
| 335 | + - Actual behavior |
| 336 | + - Steps to reproduce |
| 337 | + - Python version |
| 338 | + - Error message (if any) |
| 339 | + |
| 340 | +--- |
| 341 | + |
| 342 | +## 🏆 Bug Hunter Recognition |
| 343 | + |
| 344 | +Fix 5+ bugs and receive: |
| 345 | +- "Bug Hunter" badge on GitHub |
| 346 | +- Featured in CONTRIBUTORS.md |
| 347 | +- Special thanks in release notes |
| 348 | + |
| 349 | +--- |
| 350 | + |
| 351 | +**Help us squash bugs and make this resource better for everyone! 🐛🔨** |
0 commit comments