import random

class Passio:
    def __init__(self, password):
        self.password = password


    @classmethod
    def generate_simple_password(cls, length=8):
        if length < 8:
            length = 8

        lower = "abcdefghijklmnopqrstuvwxyz"
        upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        digits = "0123456789"
        all_chars = lower + upper + digits


        password = [
            random.choice(lower),
            random.choice(upper),
            random.choice(digits),
        ]

        for _ in range(length - 3):
            password.append(random.choice(all_chars))

        random.shuffle(password)

        return "".join(password)
    
    def get_feedback(self):
        feedback = []
        if len (self.password) < 8:
            feedback.append("Password too short")
        if not any(c.isupper() for c in self.password):
            feedback.append("Add at least one uppercase letter")
        if not any(c.islower() for c in self.password):
            feedback.append("Add at least one lowercase letter")
        if not any(c.isdigit() for c in self.password):
            feedback.append("Add at least one number")
        if not feedback:
            return "Password looks strong"
        return ", ".join(feedback)



    
    def check_strength(self):
        return self.get_feedback() == "Password looks strong"
    @staticmethod
    def greet():
        return "Welcome To passio"
