Skip to content

Commit ef12b86

Browse files
refactor: replace generic variable names with descriptive names
- Updated 31 Python files across Basics directory to use meaningful variable names - Replaced single-letter variables (a, b, c, i, j, l, n, etc.) with context-appropriate names - Improved code readability in strings, file handling, OOP, error handling, advanced topics, and projects - Files modified: 06_strings/*, 07_file_handling/*, 08_oop/*, 09_error_handling/*, 10_advanced/*, 11_projects/* Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
1 parent 4476a15 commit ef12b86

32 files changed

Lines changed: 417 additions & 275 deletions
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# ✅ GitHub Issues Created Successfully!
2+
3+
## 📊 Summary
4+
5+
**16 new issues** have been created in your GitHub repository with proper labels and descriptions.
6+
7+
---
8+
9+
## 🔴 Priority: HIGH (7 issues)
10+
11+
| # | Title | Labels | URL |
12+
|---|-------|--------|-----|
13+
| 28 | [BUG]: Prime number checker returns incorrect results | `bug`, `priority: high`, `good first issue` | https://github.com/hackdartstorm/Python/issues/28 |
14+
| 29 | [BUG]: Function named 'sum()' performs division instead of addition | `bug`, `refactor`, `good first issue` | https://github.com/hackdartstorm/Python/issues/29 |
15+
| 32 | [BUG]: Guess number game crashes on non-integer input | `bug`, `enhancement`, `good first issue` | https://github.com/hackdartstorm/Python/issues/32 |
16+
| 35 | [BUG]: Rock paper scissors game crashes on invalid input | `bug`, `enhancement`, `good first issue` | https://github.com/hackdartstorm/Python/issues/35 |
17+
| 36 | [BUG]: File handling examples reference files that don't exist | `bug`, `enhancement`, `good first issue` | https://github.com/hackdartstorm/Python/issues/36 |
18+
| 40 | [SECURITY]: Flask REST API vulnerable to SQL injection attacks | `bug`, `priority: high`, `security` | https://github.com/hackdartstorm/Python/issues/40 |
19+
| 41 | [SECURITY]: Flask debug mode enabled in production | `bug`, `priority: high`, `security` | https://github.com/hackdartstorm/Python/issues/41 |
20+
| 42 | [TESTING]: Add comprehensive unit test suite | `enhancement`, `priority: high`, `testing`, `help wanted` | https://github.com/hackdartstorm/Python/issues/42 |
21+
| 47 | [DOCUMENTATION]: Replace SECURITY.md placeholder with actual security policy | `documentation`, `priority: high`, `security`, `good first issue` | https://github.com/hackdartstorm/Python/issues/47 |
22+
| 48 | [DEVEX]: Fix CI/CD workflow referencing missing environment.yml | `bug`, `priority: high`, `devex`, `good first issue` | https://github.com/hackdartstorm/Python/issues/48 |
23+
| 58 | [DOCUMENTATION]: Add quick start guide with copy-paste examples | `documentation`, `priority: high`, `good first issue`, `beginner-friendly` | https://github.com/hackdartstorm/Python/issues/58 |
24+
25+
---
26+
27+
## 🟡 Priority: MEDIUM (5 issues)
28+
29+
| # | Title | Labels | URL |
30+
|---|-------|--------|-----|
31+
| 49 | [FEATURE]: Add database persistence to FastAPI campaign API | `feature`, `enhancement`, `priority: medium` | https://github.com/hackdartstorm/Python/issues/49 |
32+
| 54 | [REFACTOR]: Standardize naming conventions across codebase | `refactor`, `priority: medium`, `code quality` | https://github.com/hackdartstorm/Python/issues/54 |
33+
| 55 | [PERFORMANCE]: Optimize prime number checking algorithm | `performance`, `enhancement`, `priority: medium`, `good first issue` | https://github.com/hackdartstorm/Python/issues/55 |
34+
| 56 | [DEVEX]: Add comprehensive development environment setup guide | `devex`, `documentation`, `priority: medium`, `help wanted` | https://github.com/hackdartstorm/Python/issues/56 |
35+
| 57 | [FEATURE]: Add health check endpoint for monitoring | `feature`, `enhancement`, `priority: medium`, `good first issue` | https://github.com/hackdartstorm/Python/issues/57 |
36+
37+
---
38+
39+
## 🏷️ Labels Created
40+
41+
All necessary labels have been created:
42+
43+
| Label | Color | Description |
44+
|-------|-------|-------------|
45+
| `bug` | #d73a4a | Something isn't working |
46+
| `enhancement` | #a2eeef | New feature or request |
47+
| `feature` | #a2eeef | New feature |
48+
| `refactor` | #c5def5 | Code refactoring |
49+
| `documentation` | #0075ca | Documentation improvements |
50+
| `testing` | #fbca04 | Testing improvements |
51+
| `security` | #d93f0b | Security related |
52+
| `performance` | #f7c6c7 | Performance improvement |
53+
| `devex` | #d4c5f9 | Developer experience |
54+
| `code quality` | #c5def5 | Code quality improvements |
55+
| `priority: high` | #b60205 | Critical priority |
56+
| `priority: medium` | #d93f0b | Medium priority |
57+
| `priority: low` | #0e8a16 | Low priority |
58+
| `good first issue` | #7057ff | Good for newcomers |
59+
| `help wanted` | #008672 | Extra attention is needed |
60+
| `beginner-friendly` | #0e8a16 | Good for beginners |
61+
62+
---
63+
64+
## 📋 Issue Distribution
65+
66+
| Category | Count |
67+
|----------|-------|
68+
| **Bugs** | 6 |
69+
| **Security** | 3 |
70+
| **Testing** | 1 |
71+
| **Documentation** | 3 |
72+
| **Features** | 2 |
73+
| **Refactor** | 1 |
74+
| **Performance** | 1 |
75+
| **DevEx** | 2 |
76+
| **TOTAL** | **16** |
77+
78+
---
79+
80+
## 🎯 Good First Issues (8 issues)
81+
82+
Perfect for first-time contributors:
83+
84+
- #28 - Prime number checker bug
85+
- #29 - Function naming issue
86+
- #32 - Guess number input validation
87+
- #35 - Rock paper scissors validation
88+
- #36 - File handling missing files
89+
- #47 - Security policy documentation
90+
- #48 - CI/CD workflow fix
91+
- #55 - Prime checker performance
92+
- #57 - Health check endpoint
93+
- #58 - Quick start guide
94+
95+
---
96+
97+
## 🚀 Next Steps
98+
99+
### For Maintainers
100+
101+
1. **Review issues** - Check all created issues
102+
2. **Prioritize** - Start with `priority: high` labeled issues
103+
3. **Assign** - Assign issues to milestone or contributors
104+
4. **Create project board** - Organize issues in GitHub Projects
105+
106+
### For Contributors
107+
108+
1. **Browse issues** - Look for `good first issue` label
109+
2. **Comment** - Ask questions on issues you want to work on
110+
3. **Fork & PR** - Submit pull requests with fixes
111+
112+
---
113+
114+
## 📈 Recommended Action Plan
115+
116+
### Week 1: Critical Bugs
117+
- Fix #28, #29, #32, #35, #36 (all bug issues)
118+
- Estimated: 4-8 hours
119+
120+
### Week 2: Security
121+
- Address #40, #41, #47
122+
- Estimated: 6-10 hours
123+
124+
### Week 3: Infrastructure
125+
- Fix #48 (CI/CD)
126+
- Implement #42 (Testing foundation)
127+
- Estimated: 8-12 hours
128+
129+
### Week 4: Features & Quality
130+
- Implement #49, #57 (Features)
131+
- Address #54, #55 (Quality)
132+
- Estimated: 10-15 hours
133+
134+
---
135+
136+
<div align="center">
137+
138+
## 🎉 All Issues Are Live!
139+
140+
**View all issues:** https://github.com/hackdartstorm/Python/issues
141+
142+
</div>
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# String-Slicing
22

3-
c = "Hello World"
4-
print(c[-5:-1]) #Worl
5-
print(c[6:10]) #Worl
3+
text_string = "Hello World"
4+
print(text_string[-5:-1]) #Worl
5+
print(text_string[6:10]) #Worl
66

77

88

9-
print(c[:]) #Prints the Whole String
10-
print(c[:10]) #If in the beginning there is blank then consider as Zero
11-
print(c[0:]) #If in the end there is blank then consider as len-1
9+
print(text_string[:]) #Prints the Whole String
10+
print(text_string[:10]) #If in the beginning there is blank then consider as Zero
11+
print(text_string[0:]) #If in the end there is blank then consider as len-1
1212

1313
#With Skip
14-
print(c[::2]) #HloWrd
15-
print(c[2:-1:-3]) #Blank
16-
print(c[::4]) #Hor
14+
print(text_string[::2]) #HloWrd
15+
print(text_string[2:-1:-3]) #Blank
16+
print(text_string[::4]) #Hor
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
s = "Programming is awesome and challenging!"
2-
3-
print(s[2:15:2]) #ormigi
4-
print(s[-8:-2:2]) #lnig
5-
print(s[::4]) #priiwmnhen
6-
print(s[25:5:-4]) #deesn
7-
print(s[-1:-20:-3]) #!iea am
8-
print(s[12::-2]) #igimrop
9-
print(s[-5:8:-1]) #gnellahc dna emosewa si gn
10-
print(s[1::5][::-2]) #blank
1+
text_string = "Programming is awesome and challenging!"
2+
3+
print(text_string[2:15:2]) #ormigi
4+
print(text_string[-8:-2:2]) #lnig
5+
print(text_string[::4]) #priiwmnhen
6+
print(text_string[25:5:-4]) #deesn
7+
print(text_string[-1:-20:-3]) #!iea am
8+
print(text_string[12::-2]) #igimrop
9+
print(text_string[-5:8:-1]) #gnellahc dna emosewa si gn
10+
print(text_string[1::5][::-2]) #blank

Basics/06_strings/06_letter_template.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@
22

33

44

5-
#Technique One (Harder+fragile+Complex)
6-
name = input("Enter Your Name : ")
5+
# Technique One (Harder+fragile+Complex)
6+
user_name = input("Enter Your Name : ")
77
date = input("Enter the Date like : DD/MM/YY ?\nUnderstand Enter :")
8-
letter = '''
8+
letter_template = '''
99
Dear <|Name|>,
1010
You are selected!
1111
<|Date|>
1212
'''
13-
vname = letter.replace("<|Name|>",name)
14-
vdate = vname.replace("<|Date|>",date)
15-
count = len(name) #Count for name length
16-
finalCount = 25 + count #Count for name
17-
out = vname[:finalCount]
18-
fdate = vdate[finalCount:]
19-
# print(fdate)
20-
# print(out)
21-
print(out,fdate)
13+
name_replaced = letter_template.replace("<|Name|>", user_name)
14+
date_replaced = name_replaced.replace("<|Date|>", date)
15+
name_length = len(user_name) # Count for name length
16+
final_count = 25 + name_length # Count for name
17+
output_start = name_replaced[:final_count]
18+
output_end = date_replaced[final_count:]
19+
# print(output_end)
20+
# print(output_start)
21+
print(output_start, output_end)
2222

2323

24-
#Simple And Easiest Way
25-
name = input("Enter Your Name: ")
24+
# Simple And Easiest Way
25+
user_name = input("Enter Your Name: ")
2626
date = input("Enter the Date (DD/MM/YY): ")
2727

28-
letter = '''
28+
letter_template = '''
2929
Dear <|Name|>,
3030
You are selected!
3131
<|Date|>
3232
'''
3333

34-
lname = letter.replace("<|Name|>",name)
35-
ldate = lname.replace("<|Date|>",date)
36-
print(ldate)
34+
name_replaced = letter_template.replace("<|Name|>", user_name)
35+
date_replaced = name_replaced.replace("<|Date|>", date)
36+
print(date_replaced)

Basics/06_strings/08_sort_marks.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
#Write a program to accept marks of 6 students and display them in a sorted manner
1+
# Write a program to accept marks of 6 students and display them in a sorted manner
22

3-
s1 = int(input("Enter Your Marks : "))
4-
s2 = int(input("Enter Your Marks : "))
5-
s3 = int(input("Enter Your Marks : "))
6-
s4 = int(input("Enter Your Marks : "))
7-
s5 = int(input("Enter Your Marks : "))
8-
s6 = int(input("Enter Your Marks : "))
9-
l1 = []
10-
l1.append(s1)
11-
l1.append(s2)
12-
l1.append(s3)
13-
l1.append(s4)
14-
l1.append(s5)
15-
l1.append(s6)
16-
l1.sort()
17-
print(l1)
3+
student1_marks = int(input("Enter Your Marks : "))
4+
student2_marks = int(input("Enter Your Marks : "))
5+
student3_marks = int(input("Enter Your Marks : "))
6+
student4_marks = int(input("Enter Your Marks : "))
7+
student5_marks = int(input("Enter Your Marks : "))
8+
student6_marks = int(input("Enter Your Marks : "))
9+
marks_list = []
10+
marks_list.append(student1_marks)
11+
marks_list.append(student2_marks)
12+
marks_list.append(student3_marks)
13+
marks_list.append(student4_marks)
14+
marks_list.append(student5_marks)
15+
marks_list.append(student6_marks)
16+
marks_list.sort()
17+
print(marks_list)

Basics/06_strings/09_join_challenge.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
string of same numbers.
44
"""
55

6-
l = [str(7*i) for i in range(1,11)]
7-
l1 = f"\n".join(l)
8-
print(l1)
6+
multiplication_table = [str(7 * multiplier) for multiplier in range(1, 11)]
7+
vertical_string = f"\n".join(multiplication_table)
8+
print(vertical_string)
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
# File Handling - Readline Methods
22

33
# 1. Use of readline()
4-
f = open("newfile.txt")
5-
line = f.readline()
6-
while line:
7-
print(line)
8-
line = f.readline()
9-
f.close()
4+
file_handle = open("newfile.txt")
5+
current_line = file_handle.readline()
6+
while current_line:
7+
print(current_line)
8+
current_line = file_handle.readline()
9+
file_handle.close()
1010

1111
# or
1212

13-
f = open("newfile.txt")
14-
data = f.readline()
15-
while data != "":
16-
print(data)
17-
data = f.readline()
18-
f.close()
13+
file_handle = open("newfile.txt")
14+
line_data = file_handle.readline()
15+
while line_data != "":
16+
print(line_data)
17+
line_data = file_handle.readline()
18+
file_handle.close()
1919

2020
# 2. Use of readlines()
21-
f = open("newfile.txt")
22-
data = f.readlines()
23-
print(data)
24-
f.close()
21+
file_handle = open("newfile.txt")
22+
all_lines = file_handle.readlines()
23+
print(all_lines)
24+
file_handle.close()
2525

Basics/07_file_handling/03_file_multiple.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"""
55

66
try:
7-
with (open("1.txt") as a,
8-
open("2.txt") as b,
9-
open("3.txt") as c):
7+
with (open("1.txt") as file1,
8+
open("2.txt") as file2,
9+
open("3.txt") as file3):
1010
pass
1111
except FileNotFoundError:
1212
print("\n\t\t\t\t\tFile Not Found\n")
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"""
22
Store the multiplication tables in a file named Tables.txt.
33
"""
4-
l1 = [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
5-
with open("Tables.py", "w") as f:
6-
for item in l1:
7-
f.write(f"{item}\t")
4+
even_numbers = [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
5+
with open("Tables.py", "w") as output_file:
6+
for number in even_numbers:
7+
output_file.write(f"{number}\t")
88

9-
with open("Tables.py") as w:
10-
print(w.read())
9+
with open("Tables.py") as read_file:
10+
print(read_file.read())
1111

1212

Basics/07_file_handling/07_file_find_word.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
Count occurrences if found.
44
"""
55

6-
with open("poems.txt") as f:
7-
data = f.read().lower()
8-
count = data.count("twinkle")
9-
if "twinkle" in data:
10-
print(f"Twinkle Found {count} times")
6+
with open("poems.txt") as file_handle:
7+
file_data = file_handle.read().lower()
8+
word_count = file_data.count("twinkle")
9+
if "twinkle" in file_data:
10+
print(f"Twinkle Found {word_count} times")
1111
else:
1212
print("Twinkle not Found")
1313

0 commit comments

Comments
 (0)