Tell us what’s happening:
Task 19/18
Pretty sure my code is correct since i made my own personal tests but the site tests are asking for it in a different way is what I suspect. Not sure what i could be doing wrong here
Your code so far
full_dot = '●'
empty_dot = '○'
def create_character(NAME, STR, INT, CHAR):
Str = empty_dot * 10
Int = empty_dot * 10
Char = empty_dot * 10
if not isinstance(NAME, str):
return 'The character name should be a string'
elif not 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((STR), int) and isinstance(INT, int) and isinstance(CHAR, int)):
return 'All stats should be integers'
elif (STR < 1 or INT < 1 or CHAR < 1):
return 'All stats should be no less than 1'
elif (STR > 4 or INT > 4 or CHAR > 4):
return 'All stats should be no more than 4'
elif (STR + INT + CHAR) != 7:
return 'The character should start with 7 points'
else:
print(NAME)
print('STR', Str[:STR].replace('○', '●') + Str[:-STR])
print('INT',Int[:INT].replace('○', '●') + Int[:-INT])
print('CHA',Char[:CHAR].replace('○', '●') + Char[:-CHAR])
create_character('ren', 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/150.0.0.0 Safari/537.36 OPR/134.0.0.0
Challenge Information:
Build an RPG Character - Build an RPG Character
