if not isinstance(name, str):
return "The character name should be a string"
elif 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"
if not isinstance(name, int):
return "All stats should be integers"
\# elif isinstance(name, int):
elif not isinstance(strength, int):
return "All stats should be integers"
\# elif isinstance(strength, int):
elif not isinstance(intel, int):
return "All stats should be integers"
\# elif isinstance(intel, int):
elif not isinstance(charisma, int):
return "All stats should be integers"
\# elif isinstance(charisma, int):
elif name < 1 or strength < 1 or intel < 1 or charisma < 1:
return 'All stats should be no less than 1'
elif name > 4 or strength > 4 or intel > 4 or charisma > 4:
return 'All stats should be no more than 4'
elif name + strength + intel + charisma != 7:
return 'The character should start with 7 points'
return
User Story #2 says: The function should accept, in order, a character name followed by three stats: strength, intelligence, and charisma.
User Story #3 says: The character name should be validated:
User Story #4 says: The stats should also be validated:
do you see the code snippet in my code: “elif isinstance(name, int):” and “elif isinstance(strength, int):” and "elif isinstance(intel, int): " and “elif isinstance(charisma, int):”
I was thinking about if I put something in each of them, the code run will run and I will pass test #11. It says the stats need to be validated right? I just don’t know what to write. Maybe “return name” or “return strength” or “return intel” or “return charisma”? Some advice would be appreciated.