Tell us what’s happening:
I have achieved the desired result and yet steps 18 and 19 have x’s next to them. I don’t know what the issue is, I have tried a number of things, Please assist me.
Your code so far
full_dot = '●'
empty_dot = '○'
def create_character(char_name, stre, intel, char):
if not isinstance(char_name, str):
return 'The character name should be a string'
if char_name=='':
return 'The character should have a name'
if len(char_name)>10:
return 'The character name is too long'
if ' ' in char_name:
return 'The character name should not contain spaces'
if not isinstance(stre, int) or not isinstance(intel, int) or not isinstance(char, int):
return 'All stats should be integers'
if stre<1 or intel<1 or char<1:
return 'All stats should be no less than 1'
if stre>4 or intel>4 or char>4:
return 'All stats should be no more than 4'
if stre+intel+char!=7:
return 'The character should start with 7 points'
else:
alldots=10
all_stats= char_name + '\n' + 'STR' + ' ' + stre*full_dot+empty_dot*(alldots-stre)+ "\n" + 'INT' + ' ' + intel*full_dot+ empty_dot*(alldots-intel) + "\n" + 'CHA' + ' ' + char*full_dot+ empty_dot*(alldots-char) + "\n"
return all_stats
print(repr(create_character('ren',4,2,1)))
#callit=create_character('ren', 4, 2, 1)
#print(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/147.0.0.0 Safari/537.36 Edg/147.0.0.0
Challenge Information:
Build an RPG Character - Build an RPG Character