Build an RPG Character - Build an RPG Character

Tell us what’s happening:

ive followed the instructions but most of the tests wont pass what should i do

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 " " in name:
        return 'The character name should not contain spaces.'    
    if len(name) > 10:
        return 'The character name is too long.'
    if not all(isinstance(x, int)for x in (strength, intelligence, charisma)):
        return 'All stats should be integers'
    if any(x < 1 for x in (strength, intelligence, charisma)):
        return 'All stats should be no less than 1.' 
    if any(x > 4 for x in (strength, intelligence, charisma)):
        return 'All stats should be no more than 4.'
    if strength + intelligence + charisma != 7:
        return 'The character should start with 7 points.'

    return (  
name + "\n" +
"STR" + " " + full_dot * strength + empty_dot * (10 - strength) +"\n" + 
"INT" + " " + full_dot * intelligence + empty_dot * (10 - intelligence) + "\n" +
"CHA" + " " + full_dot * charisma + empty_dot * (10 - charisma)
    )
print(create_character('ren', 4,2,1)) 





                             



Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36

Challenge Information:

Build an RPG Character - Build an RPG Character

Check all of your validation messages. Do they match exactly to the instructions?

yes l hv checked them multiple times

Try copying/pasting from the instructions. All of your validation messages contain something extra that was not asked.

Tell us what’s happening:

ive followed the instructions but still most of the tests wont run

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 " " in name:
        return 'The character name should not contain spaces.'    
    if len(name) > 10:
        return 'The character name is too long.'
    if not all(isinstance(x, int)for x in (strength, intelligence, charisma)):
        return 'All stats should be integers'
    if any(x < 1 for x in (strength, intelligence, charisma)):
        return 'All stats should be no less than 1.' 
    if any(x > 4 for x in (strength, intelligence, charisma)):
        return 'All stats should be no more than 4.'
    if strength + intelligence + charisma != 7:
        return 'The character should start with 7 points.'

    return (  
name + "\n" +
"STR" + " " + full_dot * strength + empty_dot * (10 - strength) +"\n" + 
"INT" + " " + full_dot * intelligence + empty_dot * (10 - intelligence) + "\n" +
"CHA" + " " + full_dot * charisma + empty_dot * (10 - charisma)
    )
print(create_character('ren', 4,2,1)) 





                             



Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36

Challenge Information:

Build an RPG Character - Build an RPG Character

If you compare your output with the expected outputs of the failing tests, do you see any differences with the formatting?

thank you all the tests hv passed …the problem were the full stops i was putting at the end of the validation messages