Build an RPG Character - Build an RPG Character - Step 7

getting stuck at step 7 and also if I remove indentation I go get stuck at 5

Your code so far

full_dot = '●'
empty_dot = '○'

def create_character(name,strength,intellegence,charisma):
    if not isinstance(name,str):
        return 'The character name should be a string'
    if len(name) == 0:
        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(intellegence.int) or  not isinstance(charisma.int):
            return 'All stats should be integers'


#        if not isinstance(strength.int or intellegence.int or charisma.int):
#        if not isinstance(strength.int) or not isinstance(intellegence.int) or not isinstance(charisma.int):



Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.3 Safari/605.1.15

Challenge Information:

Build an RPG Character - Build an RPG Character

def create_character(name,strength,intellegence,charisma):
    if not isinstance(name,str):
        return 'The character name should be a string'
    if len(name) == 0:
        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'
        stats = [strength,intellegence,charisma]
        if not isinstance(stats.int):   
#        if not isinstance(strength.int) or  not isinstance(intellegence.int) or  not isinstance(charisma.int):
            return 'All stats should be integers'

even with this the same error

hello and welcome to fcc forum :slight_smile:

  • "arent you supposed to use “comma” instead of “dot” within “isinstance” method?
  • this has also “indentation” problem

address those changes and it should be enough to pass corresponding usecases, happy coding :slight_smile:

1 Like

Try testing your function yourself by calling it with test input and printing the result.

print(create_character('ren', 'string', 2, 1))
1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.