Skip to content
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

Update solution.py #46

Merged
merged 1 commit into from
Oct 22, 2024
Merged

Conversation

mrsandy1965
Copy link
Contributor

i have added exception handling also try to reduce the number of operations

SkillShow! 🎊🎈

Welcome! 🎉

Thank you for visiting our repository! We're excited to have you here. If you find this project useful, please consider giving it a star! ⭐

🎉 Have you reviewed the Contributing Guidelines? 🤔 (Required)

  • YES
  • NO

📝 Description

Following are the changes made :
1.Function Encapsulation: The code is wrapped in a function check_password_strength() to promote reusability and better organization.

2.Error Handling:Added a check for empty passwords, raising a ValueError if the input is empty.
Used try-except blocks to catch and handle specific exceptions, providing user-friendly error messages.
3.Optimized Character Checks:Utilized Python's built-in string methods (isupper(), islower(), isdigit(), and isalnum()) with generator expressions to check for character types. This approach is more Pythonic and improves readability.
4.Simplified Logic:The logic for determining password strength is streamlined, reducing redundancy and improving clarity.
5.Clearer Conditions:The conditions for determining password strength are clearer and more concise, making it easier to understand the flow of the program.
By implementing these changes, the password strength checker becomes more robust, user-friendly, and efficient. It can now handle various edge cases while providing clear feedback to the user.

🔧 Fixes #issue_no #4

🏷️ Initiative Participation (Required)

This pull request is associated with the following initiative. Please choose the one you are contributing to:

  • 🌸 GSSoC (Girl Script Summer of Code)
  • 🌼 GSSoC 2024 Extd.
  • [x ] 🍂 Hacktoberfest 2024
  • ❄️ Script Winter of Code (SWoC)
  • ⛄ Winter of Blockchain (WoB)
  • 🙋‍♂️ Personal
  • 📌 Other (please specify): _______________

i have added exception handling also try to reduce the number of operations
Copy link

@mrsandy1965

It's great having you contribute to this project

Thank you for opening a Pull Request 🙌 , Welcome to SkillShow 💖 We will review everything and get back to you :)

@Kushal997-das Kushal997-das added the Approved✅ Awesome! 🎉 This PR has been approved! Let the celebration begin! 🚀 label Oct 22, 2024
@Kushal997-das Kushal997-das merged commit 2c0412a into Kushal997-das:main Oct 22, 2024
3 checks passed
Copy link

@mrsandy1965 Hurray, your PR got merged into our Skill-Show 🥳. Thanks a bunch. Feel free to take another Issue. 💖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved✅ Awesome! 🎉 This PR has been approved! Let the celebration begin! 🚀
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants