Build an RPG Character - Build an RPG Character

Tell us what’s happening:

I cannot get past the 12th test, can’t tell what’s wrong because I typed it exactly as it is required, please help.

Your code so far

full_dot = '●'
empty_dot = '○'

def create_character(character_name, strength, intelligence, charisma):


    if not isinstance(character_name, str):
        return "The character name should be a string"

    elif character_name=="":
        return "The character should have a name"

    elif len(character_name)>10:
        return "The character name is too long"

    elif " " in character_name:
        return "The character name should not contain spaces"
    
    if not isinstance(strength, int):
        return "All stats should be integers"
    if not isinstance(intelligence, int):
        return "All stats should be integers"
    if not isinstance(charisma, int):
        return "All stats should be integers"

    if strength<1:
        return "All stats should be no less than 1"
    if intelligence<1:
        return "All stats should be no less than 1"
    if charisma<1:
        return "All stats should be no less than 1"

    if strength>4:
        return "All stats should be no more than 4"
    if intelligence>4:
        return "All stats should be no more than 4"
    if charisma>4:
        return "All stats should be no more than 4"

    if strength+intelligence+charisma != 7:
        return "The character should start with 7 points"

    return f"{character_name}\nSTR ●●●●○○○○○○\nINT ●●○○○○○○○○\nCHA ●○○○○○○○○○"


print(create_character('ren', 4, 2, 1))

        
    





Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36

Challenge Information:

Build an RPG Character - Build an RPG Character

what if the character has different stats? and not 4,2,1?

1 Like

Thank you, I figured it out, I was only focusing on hard-coding it lol