Tell us what’s happening:
I could not pass the 18th and 19th tests and i don’t know what the problem is. this is my code:
Your code so far
full_dot = '●'
empty_dot = '○'
def create_character(name,strenght,intelligence,charisma):
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(strenght, int) or not isinstance(intelligence, int) or not isinstance(charisma, int):
return "All stats should be integers"
elif not strenght>=1 or not intelligence>=1 or not charisma>=1:
return "All stats should be no less than 1"
elif not strenght<=4 or not intelligence<=4 or not charisma<=4:
return "All stats should be no more than 4"
elif strenght+intelligence+charisma!=7:
return "The character should start with 7 points"
else: return name,"/nSTR ",full_dot*strenght,empty_dot*(10-strenght),"/nINT ",full_dot*intelligence,empty_dot*(10-intelligence),"/nCHA ",full_dot*charisma,empty_dot*(10-charisma)
create_character("ren",4,2,1)
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36
Challenge Information:
Build an RPG Character - Build an RPG Character