Tell us what’s happening:
Not sure how to achieve point number 7, 9, 10 and 12 for the RPG challenge.
Failed:7. The create_character function should not say that the character is too long when it’s not longer than 10 characters.
Failed:9. When create_character is called with a first argument that does not contain a space it should not return The character name should not contain spaces.
10. When create_character is called with a second, third or fourth argument that is not an integer it should return All stats should be integers.
12. When create_character is called with a second, third or fourth argument that is lower than 1 it should return All stats should be no less than 1.
Your code so far
full_dot = '●'
empty_dot = '○'
def create_character(name, strength, intelligence, charisma):
#Name validations
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 name.count("") > 0:
return "The character name should not contain spaces"
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36
Challenge Information:
Build an RPG Character - Build an RPG Character