Tell us what’s happening:
The question is to return the line if any parameters / stats are less than one while calling function. I used this below code to run but its not satisfying the test conditions.
stats={strength:‘STR’,intelligence:‘INT’,charisma:‘CHA’}
for stat in stats.values():
if stat < 1:
return ‘All stats should be no less than 1’
Your code so far
def create_character(char_name,strength,intelligence,charisma):
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((strength,intelligence,charisma),int):
return 'All stats should be integers'
stats={strength:'STR',intelligence:'INT',charisma:'CHA'}
for stat in stats.values():
if stat < 1:
return 'All stats should be no less than 1'
for stat in stats.values():
if stat > 4:
return "All stats should be no more than 4"
full_dot = '●'
empty_dot = '○'
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36
Challenge Information:
Build an RPG Character - Build an RPG Character
