Tell us what’s happening:
Been stuck on this all day. All tests pass, except for numbers 10, 12, and 14. At this point, anytime I change something, more tests fail. I feel like I’ve missed something in the information we were given, but I also thought I had done everything correctly. Could I get some help in figuring out why these three tests aren’t passing?
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')
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')
if not isinstance((strength) and (intelligence) and (charisma), int):
return('All stats should be integers')
elif (strength and intelligence and charisma) < 1:
return('All stats should be no less than 1')
elif (strength and intelligence and 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'{name}\nSTR {full_dot*strength}{empty_dot*(10-strength)}\nINT {full_dot*intelligence}{empty_dot*(10-intelligence)}\nCHA {full_dot*charisma}{empty_dot*(10-charisma)}')
print(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/145.0.0.0 Safari/537.36
Challenge Information:
Build an RPG Character - Build an RPG Character