Build an RPG Character - Build an RPG Character

Tell us what’s happening:

So in Buld an RPG Character, steps 18 and 19, im having a bit of trouble printing the required steps onto the console. I feel that I am missing a step that requires using the dot variables but im not exactly sure how to use it. If anyone could help me and also suggest any ways to shorten the amount of elif statements needed. Please and thank you.

Your code so far

def create_character(name, STR, INT, CHA):
    full_dot = '●'
    empty_dot = '○'
    if not isinstance(name, str):
        return 'The character name should be a string'
    elif name == '':
        return 'The character should have a name'
    elif len(name) > 10:
        return 'The character name is too long'
    elif ' ' in name:
        return 'The character name should not contain spaces'
    elif not isinstance(STR, int):
        return 'All stats should be integers'
    elif not isinstance(INT, int):
        return 'All stats should be integers'
    elif not isinstance(CHA, int):
        return 'All stats should be integers'
    elif STR < 1:
        return 'All stats should be no less than 1'
    elif INT < 1:
        return 'All stats should be no less than 1'
    elif CHA < 1:
        return 'All stats should be no less than 1'
    elif STR > 4:
        return 'All stats should be no more than 4'
    elif INT > 4:
        return 'All stats should be no more than 4'
    elif CHA > 4:
        return 'All stats should be no more than 4'
    elif STR + INT + CHA != 7:
        return 'The character should start with 7 points'
create_character('ren', 4, 2, 1)


    


Your browser information:

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

Challenge Information:

Build an RPG Character - Build an RPG Character

Welcome to the forum @raima1!

Your function needs to return the string asked for in User Story #5. Just take it a step at a time. You build an f-string if it will make it easier, but make an attempt.

I would put the full_dot and empty_dot variables back in the global space though. That might cause the tests to fail.

Regarding your if elif statements, you can combine several expressions into one statement using the and and or operators, whichever applies.

For example:

if (expression1) or (expression2) or (expression3):
   do this

Just remember that each expression is evaluated separately, so if you are using not to negate one expression, you need to also use it for the other expressions.

Happy coding!