-
Notifications
You must be signed in to change notification settings - Fork 7.9k
feat:new examples #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat:new examples #108
Conversation
WalkthroughThe changes introduce a comprehensive regex tutorial script replacing a simple search example, showcasing multiple Changes
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (5)
Day-02/examples/03-regex-findall.py (1)
54-54
: Consider mentioning the limitations of the simplified email pattern.The simplified email pattern
r"\w+@\w+\.\w+"
works well for educational purposes but has limitations (e.g., won't match emails with dots in the local part like "john.doe@example.com" or subdomains like "user@mail.example.com").Consider adding a comment to clarify this is a simplified pattern:
-pattern6 = r"\w+@\w+\.\w+" # \w+ = word characters, @ = literal @, \. = literal dot +pattern6 = r"\w+@\w+\.\w+" # \w+ = word characters, @ = literal @, \. = literal dot (simplified pattern)Day-02/examples/test.py (4)
1-2
: Improve variable naming for better readability.The variable names
name
andname1
are not descriptive. Consider using more meaningful names likefirst_name
andlast_name
for better code readability.-name="shivam" -name1="tiwari" +first_name = "shivam" +last_name = "tiwari"
3-3
: Consider using f-strings for better readability.While string concatenation with
+
works, f-strings provide better readability and performance.-print(name+" "+name1) +print(f"{first_name} {last_name}")
4-4
: Add clarity to the length calculation.The length calculation concatenates the strings without a space, which might be confusing for learners. Consider adding a comment to explain this behavior.
-print(len(name+name1)) +print(len(first_name + last_name)) # Length without space
1-4
: Add comments and structure for educational value.Since this appears to be an educational example, adding comments would help learners understand the purpose of each operation.
+# Basic string operations example + first_name = "shivam" last_name = "tiwari" + +# Concatenate strings with space print(f"{first_name} {last_name}") + +# Calculate length of concatenated string (without space) print(len(first_name + last_name))
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
Day-02/examples/03-regex-findall.py
(1 hunks)Day-02/examples/test.py
(1 hunks)
🔇 Additional comments (2)
Day-02/examples/03-regex-findall.py (2)
1-84
: Excellent educational structure for regex learning!This comprehensive regex tutorial provides a well-structured, step-by-step approach to learning regex patterns. The progression from simple literal matches to more complex patterns like emails and phone numbers is pedagogically sound.
70-83
: Great addition of the regex cheat sheet!The cheat sheet provides a valuable quick reference for beginners. The explanations are clear and concise, making it easy for learners to understand the purpose of each regex symbol.
new examples
Summary by CodeRabbit