unable to get pass the test number 3. I tried to rewrite this. Help me to understand the error behind this. Thank you!
full_dot = ‘●’
empty_dot = ‘○’
def create_character (name, strength, intelligence, charisma):
if not isinstance(name, str):
return "The character name should be a string"
if name == "":
return "The character should have a name"
if len(name) > 10:
return "The character name is too long"
if " " in name:
return "The character name should not contain spaces"
stats = \[strength, intelligence, charisma\]
if not all(isinstance(stats), int):
return'All stats should be integers'
if any (stats) <1:
return'All stats should be no less than 1'
if any (stats) >4:
return 'All stats should be no more than 4'
if sum (stats.values()) !=7:
return'The character should start with 7 points'