Build an RPG Character - Build an RPG Character

Tell us what’s happening:

from what i can see my code is perfectly fine its just it somehow doesnt pass at the ‘checking if all values from strength charisma and int are integers’ even tho console displays correct results..? is this bugged or am i really doing smth wrong

(yes i do realize my code looks messy, sorry)

Your code so far

full_dot = '●'
empty_dot = '○'
def create_character(charName, strength, intelligence, charisma):
    stats = f'STR {strength * full_dot}{empty_dot * (10 - strength)}\nINT {intelligence * full_dot}{empty_dot * (10 - intelligence)} \nCHA {charisma * full_dot}{empty_dot * (10 - charisma)}'
    if not isinstance(charName, str): 
        return "The character name should be a string"
    elif charName == '':
        return 'The character should have a name'
    elif len(charName) > 10:
        return 'The character name is too long'
    elif ' ' in charName:
        return 'The character name should not contain spaces'
    elif not isinstance(strength or charisma or intelligence, int):
        return 'All stats should be integers'
    elif (strength or intelligence or charisma) <1:
        return 'All stats should be no less than 1'
    elif (strength or intelligence or charisma) >4:
        return 'All stats should be no more than 4'
    elif (strength + intelligence + charisma) != 7:
        return 'The character should start with 7 points'
    else:
        return(f'{charName}\n{stats}')


print(create_character('hujjebayhe', 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/147.0.0.0 Safari/537.36

Challenge Information:

Build an RPG Character - Build an RPG Character

Welcome to the forum @dybb!

You cannot check multiple variables against a type using isinstance().

Happy coding!

are you sure you should be doing this before checking that the values are good? aren’t you going to get errors if strength is not a number?