# Build an RPG Character - Build an RPG Character

**URL:** <https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/791376>\
**Category:** Curriculum Help\
**Tags:** python\
**Created:** [June 14, 2026, 5:07pm UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/791376 "2026-06-14T17:07:25Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![ROSE71](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@ROSE71](https://forum.freecodecamp.org/u/ROSE71)\
**Post date:** [June 14, 2026, 5:07pm UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/791376/1 "2026-06-14T17:07:25Z")

</div>

### Tell us what’s happening:

I am on the " Build an RPG Character" lab  
test#2 fails: when create a character is called with a first argument that is not a string it should return " The character name should be a string '" what i did: \* I added print(repr(create\_character(123, 1, 1 ,1)))  
to my code it prints “The character name should be a string”(exactly as required no extra spaces, no hidden characters)  
the test still fails  
is this a bug in test runner, or am i missing something??

### Your code so far

```py
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 len(name) > 10:
        return "The character name is too long."  
    if name == "":
        return "The character should have a name."
    if ' ' in name:
        return "The character name should not contain spaces."
            
    stats = {"STR": strength, "INT": intelligence, "CHA": charisma}
    for stat_name, value in stats.items():
        if not isinstance(value, int):
            return "All stats should be integers."
        if value < 1:
            return " All stats should be no less than 1."
        if value > 4:
            return " All stats should be no more than 4."
    if sum(stats.values()) != 7:
        return "The character should start with 7."

    line1 = name
    line2 = f"STR {full_dot * strength}{empty_dot * (10 - strength)}"
    line3 = f"INT {full_dot * intelligence}{empty_dot *(10 - intelligence)}"
    line4 = f"CHA {full_dot * charima}{empty_dot *(10 - charisma)}"
    return f"{line1}\n{line2}\n{line3}\n{line4}"
    
    

```

### Your browser information:

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36`

### Challenge Information:

Build an RPG Character - Build an RPG Character

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/python-v9/lab-rpg-character/build-an-rpg-character)**
>
> Learn to Code — For Free

GitHub Link: [https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/challenges/english/blocks/lab-rpg-character/67d83df6f82eda3868dd2a84.md](https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/challenges/english/blocks/lab-rpg-character/67d83df6f82eda3868dd2a84.md)

---

<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:** [June 14, 2026, 5:09pm UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/791376/2 "2026-06-14T17:09:28Z")

</div>

Welcome to the forum @ROSE71,

> [@ROSE71](#):
>
> `return "The character name should be a string."`

Please review all of your return messages to make sure they match the instructions (check punctuation).

Happy coding

---

<div class="post-metadata">

**Author:** ![ROSE71](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@ROSE71](https://forum.freecodecamp.org/u/ROSE71)\
**Post date:** [June 14, 2026, 5:12pm UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/791376/3 "2026-06-14T17:12:30Z")

</div>

Yes I checked it and the output is exactly this . I feel so stuck I’ve been working on this since afternoon I’ve checked all the ways it still shows the exact same issue

---

<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:** [June 14, 2026, 5:12pm UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/791376/4 "2026-06-14T17:12:58Z")

</div>

They are not exact. Check again.

---

<div class="post-metadata">

**Author:** ![ROSE71](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@ROSE71](https://forum.freecodecamp.org/u/ROSE71)\
**Post date:** [June 14, 2026, 5:13pm UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/791376/5 "2026-06-14T17:13:54Z")

</div>

Sorry I don’t get it ,?

---

<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:** [June 14, 2026, 5:14pm UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/791376/6 "2026-06-14T17:14:21Z")

</div>

Please explain what you don’t get…

Try this:

copy/paste one of the messages in the instructions  
copy/paste the same message from your code beneath it to compare

what is different?

---

<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:** [June 14, 2026, 5:18pm UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/791376/7 "2026-06-14T17:18:07Z")

</div>

> [@ROSE71](#):
>
> it should return " The character name should be a string '"

there isn’t a period/full stop

> [@ROSE71](#):
>
> `return "The character name should be a string."`

there is a period/full stop

they are not the same

---

<div class="post-metadata">

**Author:** ![ROSE71](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@ROSE71](https://forum.freecodecamp.org/u/ROSE71)\
**Post date:** [June 14, 2026, 5:44pm UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/791376/8 "2026-06-14T17:44:09Z")

</div>

i removed the periods and the problem i am facing now is step 1&2 are correct but from 3 alternatively its showing error…like 3..5..7..till 13 then 14th is correct and from 15 to 19 its all wrong again …now I’m even more confused about what’s happening.

---

<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:** [June 14, 2026, 5:56pm UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/791376/9 "2026-06-14T17:56:33Z")

</div>

When you see this message in the console after running the tests, check your browser’s console to see the error:

> Your code raised an error before any tests could run. Please fix it and try again.

You have a typo.

Test what your function returns like this:

`print(create_character('ren', 4, 2, 1))`

---

<div class="post-metadata">

**Author:** ![ROSE71](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@ROSE71](https://forum.freecodecamp.org/u/ROSE71)\
**Post date:** [June 14, 2026, 6:12pm UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/791376/10 "2026-06-14T18:12:45Z")

</div>

i give up at this point nothing’s working

---

<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:** [June 14, 2026, 6:18pm UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/791376/11 "2026-06-14T18:18:15Z")

</div>

There is very little wrong with your code at this point, so maybe take a break and come back to it when you’re refreshed.

---

<div class="post-metadata">

**Author:** ![ROSE71](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@ROSE71](https://forum.freecodecamp.org/u/ROSE71)\
**Post date:** [June 14, 2026, 6:21pm UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/791376/12 "2026-06-14T18:21:55Z")

</div>

Alright .. thanks for the guidance though.

---

<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:** [June 14, 2026, 6:28pm UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/791376/13 "2026-06-14T18:28:23Z")

</div>

You’re welcome. Please don’t let this overwhelm you. You’re doing great…your logic is solid. You just have a typo and a couple more errors with non-matching messages re: spacing.

---

<div class="post-metadata">

**Author:** ![ROSE71](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@ROSE71](https://forum.freecodecamp.org/u/ROSE71)\
**Post date:** [June 15, 2026, 11:54am UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/791376/14 "2026-06-15T11:54:20Z")

</div>

yeah there was an spelling error that went unnoticed the code passed .. again thankyou for the help. finally passed the tests .

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [July 13, 2026, 11:54am UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/791376/15 "2026-07-13T11:54:58Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
