Password Strength Checker
Check password strength based on multiple criteria.
AdvancedPhase 6 - Category 5: Real-World Logic ProblemsExample 1 of 15
password-strength-checker.py
1# Take password2password = input("Enter password: ")34# Check criteria5has_length = len(password) >= 86has_upper = any(char.isupper() for char in password)7has_lower = any(char.islower() for char in password)8has_digit = any(char.isdigit() for char in password)9has_special = any(not char.isalnum() for char in password)1011# Calculate strength12score = sum([has_length, has_upper, has_lower, has_digit, has_special])1314if score == 5:15 print("Strong password")16elif score >= 3:17 print("Medium password")18else:19 print("Weak password")
Output
Enter password: MyPass123! Strong password Enter password: password Weak password
What's going on
Check multiple password criteria.
Key Concepts:
Check length, case, digits, special chars
Count criteria met
Rate strength
🔗Related Content
- 📖
Phase 6 - Learn Concepts
Review Phase 6 concepts and explanations
- 📝
Phase 6 - Quiz
Test your Phase 6 understanding with quiz questions
- 💻
Phase 6 - All Practice Problems
Explore all practice problems for Phase 6
- 🎓
Master Your Logic Building - Complete Course
Browse all phases and tutorials
- 🧠
Logic Building Overview
Learn about the complete logic building curriculum