Build an RPG Character - Build an RPG Character

Tell us what’s happening:

it says syntax error in console in fcc site but running same code in VS code works perfectly, here’s the ss:

Your code so far

def create_character(nme, strength, intel, char):
    if not isinstance(nme, str):
        return "The character name should be a string"

    if not nme:
        return "The character should have a name"

    if len(nme) > 10:
        return "The character name is too long"
    
    if " " in nme:
        return "The character name should not contain spaces"

    if not (isinstance(strength, int) and isinstance(intel, int) and isinstance(char, int)):
        return "All stats should be integers"

    if (strength < 1 or intel < 1 or char < 1):
        return "All stats should be no less than 1"

    if (strength > 4 or intel > 4 or char > 1):
        return "All stats should be no more than 4"

    if (strength + intel + char) != 7:
        return "The character should start with 7 points"

    return f"{nme}\nSTR {"●" * strength}{"○" * (10-strength)}\nINT {"●" * intel}{"○" * (10-intel)}\nCHA {"●" * char}{"○" * (10-char)}"

full_dot = '●'
empty_dot = '○'


Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36

Challenge Information:

Build an RPG Character - Build an RPG Character

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/lab-rpg-character/67d83df6f82eda3868dd2a84.md at main · freeCodeCamp/freeCodeCamp · GitHub

Welcome to the forum @ruthlomyst,

Please use the variable names, not the variable values, to create your final string.

Happy coding