Build an RPG Character

full_dot = '●'

empty_dot = '○'



def create_character(name, strength, inteligence, charisma):

    if not isinstance(name, str):

        return('The character name should be a string')

    if name == "":

        return('The character should have a name')

    if len(name) >10:

        return('The character name is too long')

    if ' ' in name:

        return('The character name should not contain spaces')



    if not isinstance(strength, int) or not isinstance(inteligence, int) or not isinstance(charisma, int):

        return 'All stats should be integers'

    if strength < 1 or inteligence < 1 or charisma < 1:

        return 'All stats should be no less than 1'

    if strength > 4 or inteligence > 4 or charisma > 4:

        return 'All stats should be no more than 4'

    if strength + inteligence + charisma != 7:

        return 'The character should start with 7 points'




    return name

    return 'STR' + ' ' + full_dot\*strength + empty_dot\*(10-strength)

    return 'INT' + ' ' + full_dot\*inteligence + empty_dot\*(10-inteligence)

    return 'CHA' + ' ' + full_dot\*charisma + empty_dot\*(10-charisma)

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

I get error for the last 2 items 18 and 19:
create_character('ren', 4, 2, 1) should return ren\nSTR ●●●●○○○○○○\nINT ●●○○○○○○○○\nCHA ●○○○○○○○○○.
Any idea? Thanks

Welcome to the forum @JohnTsavo!

I’ve edited your post for code readability. In the future, please use the “Help” button to ask for help. That way your code will be formatted correctly and a link to the challenge will be included.

I’m seeing this syntax error in the console:

Traceback (most recent call last):
  File "main.py", line 48
    return 'STR' + ' ' + full_dot\*strength + empty_dot\*(10-strength)
                                  ^
SyntaxError: unexpected character after line continuation character

Happy coding!

Thank you. Where this “\” symbol comes from? I do not have this in my code…
My code says “return ‘STR’ + ’ ’ + full_dot*strength + empty_dot*(10-strength)”

The '\' is in your code because you did not use the “Help” button to package up your formatted code.

Your function should have only one return statement. It stops processing as soon as it hits a return, so all you see in the console is the name.