# RPG Character code fail

**URL:** <https://forum.freecodecamp.org/t/rpg-character-code-fail/800005>\
**Category:** Curriculum Help\
**Tags:** python\
**Created:** [September 11, 2026, 5:32pm UTC](https://forum.freecodecamp.org/t/rpg-character-code-fail/800005 "2026-09-11T17:32:21Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![code\_master](https://avatars.discourse-cdn.com/v4/letter/c/d26b3c/32.png) [@code\_master](https://forum.freecodecamp.org/u/code_master)\
**Post date:** [September 11, 2026, 5:32pm UTC](https://forum.freecodecamp.org/t/rpg-character-code-fail/800005/1 "2026-09-11T17:32:21Z")

</div>

## Tell us what’s happening:

I can’t get past test #11 on RPG Character Creation in the Python curriculum. Anyone care to give advice?

## Your code so far:

full\_dot = ‘●’

empty\_dot = ‘○’

def create\_character(name, strength, intel, charisma):

```
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 

```

```auto

```

## 

Lesson URL: [https://www.freecodecamp.org/learn/python-v9/lab-rpg-character/build-an-rpg-character](https://www.freecodecamp.org/learn/python-v9/lab-rpg-character/build-an-rpg-character)

---

<div class="post-metadata">

**Author:** ![dhess](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/dhess/32/406235_2.png) [@dhess](https://forum.freecodecamp.org/u/dhess)\
**Post date:** [September 11, 2026, 5:44pm UTC](https://forum.freecodecamp.org/t/rpg-character-code-fail/800005/2 "2026-09-11T17:44:32Z")

</div>

Welcome to the forum @code_master,

Which of the function parameters represent the stats?

Happy coding

---

<div class="post-metadata">

**Author:** ![code\_master](https://avatars.discourse-cdn.com/v4/letter/c/d26b3c/32.png) [@code\_master](https://forum.freecodecamp.org/u/code_master)\
**Post date:** [September 11, 2026, 6:00pm UTC](https://forum.freecodecamp.org/t/rpg-character-code-fail/800005/3 "2026-09-11T18:00:51Z")

</div>

Is it a rhetorical question?

name, strength, intel, charisma

---

<div class="post-metadata">

**Author:** ![dhess](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/dhess/32/406235_2.png) [@dhess](https://forum.freecodecamp.org/u/dhess)\
**Post date:** [September 11, 2026, 6:03pm UTC](https://forum.freecodecamp.org/t/rpg-character-code-fail/800005/4 "2026-09-11T18:03:26Z")

</div>

No.

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:

---

<div class="post-metadata">

**Author:** ![code\_master](https://avatars.discourse-cdn.com/v4/letter/c/d26b3c/32.png) [@code\_master](https://forum.freecodecamp.org/u/code_master)\
**Post date:** [September 11, 2026, 6:42pm UTC](https://forum.freecodecamp.org/t/rpg-character-code-fail/800005/5 "2026-09-11T18:42:05Z")

</div>

how can I implement it? I cannot find the solution.

---

<div class="post-metadata">

**Author:** ![dhess](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/dhess/32/406235_2.png) [@dhess](https://forum.freecodecamp.org/u/dhess)\
**Post date:** [September 11, 2026, 6:53pm UTC](https://forum.freecodecamp.org/t/rpg-character-code-fail/800005/6 "2026-09-11T18:53:44Z")

</div>

> [@dhess](#):
>
> Which of the function parameters represent the stats?

First, get clear about which parameters represent the stats. The review all of the user stories again to make sure you are implementing them as asked.

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [September 11, 2026, 6:56pm UTC](https://forum.freecodecamp.org/t/rpg-character-code-fail/800005/7 "2026-09-11T18:56:23Z")

</div>

> [@code\_master](#):
>
> `name < 1`

for example, is `name` a number? if not, why are you comparing it as a number?

---

<div class="post-metadata">

**Author:** ![code\_master](https://avatars.discourse-cdn.com/v4/letter/c/d26b3c/32.png) [@code\_master](https://forum.freecodecamp.org/u/code_master)\
**Post date:** [September 12, 2026, 9:33am UTC](https://forum.freecodecamp.org/t/rpg-character-code-fail/800005/8 "2026-09-12T09:33:00Z")

</div>

I don’t get it. I’m stuck.

---

<div class="post-metadata">

**Author:** ![dhess](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/dhess/32/406235_2.png) [@dhess](https://forum.freecodecamp.org/u/dhess)\
**Post date:** [September 12, 2026, 12:30pm UTC](https://forum.freecodecamp.org/t/rpg-character-code-fail/800005/9 "2026-09-12T12:30:57Z")

</div>

Please talk about how you are stuck.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more you say, the more we can help!

---

<div class="post-metadata">

**Author:** ![code\_master](https://avatars.discourse-cdn.com/v4/letter/c/d26b3c/32.png) [@code\_master](https://forum.freecodecamp.org/u/code_master)\
**Post date:** [September 12, 2026, 12:34pm UTC](https://forum.freecodecamp.org/t/rpg-character-code-fail/800005/10 "2026-09-12T12:34:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [September 12, 2026, 12:38pm UTC](https://forum.freecodecamp.org/t/rpg-character-code-fail/800005/11 "2026-09-12T12:38:25Z")

</div>

are you sure you should validate `name` the same way as `strength` ant `intel`?

---

<div class="post-metadata">

**Author:** ![dhess](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/dhess/32/406235_2.png) [@dhess](https://forum.freecodecamp.org/u/dhess)\
**Post date:** [September 12, 2026, 12:44pm UTC](https://forum.freecodecamp.org/t/rpg-character-code-fail/800005/12 "2026-09-12T12:44:23Z")

</div>

Look at the first condition in your code:

> [@code\_master](#):
>
> ```auto
> if not isinstance(name, str):
> 
> return "The character name should be a string"
> 
> ```

You’re checking to make sure `name` is a `string`, right?

Then you turn around and later try to check if `name` is an` int`:

> [@code\_master](#):
>
> ```auto
> if not isinstance(name, int):
> 
> return "All stats should be integers"
> 
> ```

So, should `name` be a `string` or an `int`? What does User Story #2 tell you about your function parameters?

> [@dhess](#):
>
> The function should accept, in order, a character name followed by three stats: strength, intelligence, and charisma.

And User Story #5 provides an example function call: `create_character('ren', 4, 2, 1)`

What’s the first argument in that function call?
