Build an RPG Character - Build an RPG Character

Tell us what’s happening:

Hi I can’t seem to complete 8 and 9, I’ve tried different methods but I am stumped. Any criticism or help is greatly appreciated.

Your code so far

full_dot = '●'
empty_dot = '○'
def create_character(name, strength, intelligence, 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 strength or intelligence or charisma != int:
        return 'All stats should be integers'
    if strength or intelligence or charisma < 1:
        return 'All stats should be no less than 1'
    if strength or intelligence or charisma > 4:
        return 'All stats should be no more than 4'


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.2 Safari/605.1.15

Challenge Information:

Build an RPG Character - Build an RPG Character

Hi @isaiahmcdonald , welcome to freeCodeCamp !

The problem comes from your if statements. The “or” key word doesn’t work like this, you have to precise each time the condition. For example

test_1 = 0
test_2 = 1
if test_1 or test_2 == 0 :
    print('hello')

here, the code check if test_1 is a truthy value or if test_2 is equal to 0, but not if one of the two values is equal to 0.

okay so should I restructure my if statements without using “or” and start over

It is a good idea to use “or”, but there’s just a syntax problem. The computer is checking in a very specific way :

if <condition> or <another condition> :
    ...

It sees what is between the “if” and the “or” as a condition, an between the “or” and the “:” as a totally separated condition. You cannot group all the conditions at the end as you did.