# Build an RPG Character - Build an RPG Character

**URL:** <https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/771237>\
**Category:** Curriculum Help\
**Tags:** python\
**Created:** [December 24, 2025, 3:17am UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/771237 "2025-12-24T03:17:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kmmdj](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@kmmdj](https://forum.freecodecamp.org/u/kmmdj)\
**Post date:** [December 24, 2025, 3:17am UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/771237/1 "2025-12-24T03:17:11Z")

</div>

### Tell us what’s happening:

The code seems to work but I cant get the last two tests:  
11. create\_character(‘ren’, 4, 2, 1) should return ren\nSTR ●●●●○○○○○○\nINT ●●○○○○○○○○\nCHA ●○○○○○○○○○.  
12. When create\_character is called with valid values it should output the character stats as required."

Sorry if its not the most concise code, Im new to this

### Your code so far

```py
full_dot = '●'
empty_dot = '○'

def create_character(name,strength,intelligence,charisma):
    #Check Name
    if type(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'
    else:
        print(name)
        #Check Stats
        if not type(strength)==int or not type(intelligence)==int or not type(charisma)==int:
            return 'All stats should be integers'
        elif strength < 1 or intelligence < 1 or charisma < 1:
            return 'All stats should be no less than 1'
        elif strength>4 or intelligence>4 or charisma>4:
            return 'All stats should be no more than 4'
        elif strength+intelligence+charisma!=7:
            return 'The character should start with 7 points'
        else:
            STR='STR'+' '+ full_dot*strength + empty_dot*(10-strength)
            INT='INT'+' '+ full_dot*intelligence + empty_dot*(10-intelligence)
            CHA='CHA'+' '+ full_dot*charisma + empty_dot*(10-charisma)
            result = print(STR +"\n"+ INT +"\n"+ CHA)
            return result

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

```

### Your browser information:

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

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

---

<div class="post-metadata">

**Author:** ![kmmdj](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@kmmdj](https://forum.freecodecamp.org/u/kmmdj)\
**Post date:** [December 24, 2025, 3:20am UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/771237/2 "2025-12-24T03:20:31Z")

</div>

### Tell us what’s happening:

Idk whats wrong, it seems to run fine but the last two tests say failed:  
11. create\_character(‘ren’, 4, 2, 1) should return ren\nSTR ●●●●○○○○○○\nINT ●●○○○○○○○○\nCHA ●○○○○○○○○○.  
12. When create\_character is called with valid values it should output the character stats as required.

Also Im sorry its not super professional or concise, this is my first time coding.

### Your code so far

```py
full_dot = '●'
empty_dot = '○'

def create_character(name,strength,intelligence,charisma):
    #Check Name
    if type(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'
    else:
        print(name)
        #Check Stats
        if not type(strength)==int or not type(intelligence)==int or not type(charisma)==int:
            return 'All stats should be integers'
        elif strength < 1 or intelligence < 1 or charisma < 1:
            return 'All stats should be no less than 1'
        elif strength>4 or intelligence>4 or charisma>4:
            return 'All stats should be no more than 4'
        elif strength+intelligence+charisma!=7:
            return 'The character should start with 7 points'
        else:
            STR='STR'+' '+ full_dot*strength + empty_dot*(10-strength)
            INT='INT'+' '+ full_dot*intelligence + empty_dot*(10-intelligence)
            CHA='CHA'+' '+ full_dot*charisma + empty_dot*(10-charisma)
            result = print(STR +"\n"+ INT +"\n"+ CHA)
            return result

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

```

### Your browser information:

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

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

---

<div class="post-metadata">

**Author:** ![Teller](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/teller/32/412338_2.png) [@Teller](https://forum.freecodecamp.org/u/Teller)\
**Post date:** [December 24, 2025, 3:38am UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/771237/3 "2025-12-24T03:38:29Z")

</div>

Welcome to the forum @kmmdj

Try removing all the print calls in the function.

Happy coding

---

<div class="post-metadata">

**Author:** ![Teller](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/teller/32/412338_2.png) [@Teller](https://forum.freecodecamp.org/u/Teller)\
**Post date:** [December 24, 2025, 3:40am UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/771237/4 "2025-12-24T03:40:05Z")

</div>

Hi @kmmdj

I went ahead and combined your posts for you. In the future, just reply to the original thread to add further updates.

Thanks.

---

<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:** [December 24, 2025, 8:44am UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/771237/5 "2025-12-24T08:44:21Z")

</div>

the tests test what your function is returning

check what it is returning `print("My function output is", create_character('ren', 4, 2, 1))`

---

<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:** [May 7, 2026, 7:49am UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-build-an-rpg-character/771237/6 "2026-05-07T07:49:35Z")

</div>

Closed on May 7, 2026, 7:49am UTC

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