Tell us what’s happening:
Hey yall, so im pretty sure I ahve completed all of the checks but 18 adn 19 haven’t cleared yet. I have completed all of the other checks but don’ t know see where I am going wrong for basically check 18. Any advice?
Thanks and happy coding!
Your code so far
full_dot = '●'
empty_dot = '○'
def create_character(character_name, strength,intelligence,charisma):
stats = (strength, intelligence,charisma)
if not isinstance(character_name, str):
return('The character name should be a string')
elif character_name == '':
return('The character should have a name')
elif len(character_name) > 10:
return('The character name is too long')
elif ' ' in character_name:
return('The character name should not contain spaces')
elif not all(isinstance(x, int) for x in stats):
return('All stats should be integers')
for x in stats:
if x < 1:
return('All stats should be no less than 1')
elif x > 4:
return('All stats should be no more than 4')
if not sum(stats) == 7:
return('The character should start with 7 points')
else:
print(f'{character_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))}')
create_character('ren',4,2,1)
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0
Challenge Information:
Build an RPG Character - Build an RPG Character