# Build an RPG Character (Shorter and More Concise Way to Validate Stats

**URL:** <https://forum.freecodecamp.org/t/build-an-rpg-character-shorter-and-more-concise-way-to-validate-stats/790311>\
**Category:** Curriculum Help\
**Tags:** python\
**Created:** [May 30, 2026, 7:45pm UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-shorter-and-more-concise-way-to-validate-stats/790311 "2026-05-30T19:45:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kansangmuang-bit](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/kansangmuang-bit/32/413391_2.png) [@kansangmuang-bit](https://forum.freecodecamp.org/u/kansangmuang-bit)\
**Post date:** [May 30, 2026, 7:45pm UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-shorter-and-more-concise-way-to-validate-stats/790311/1 "2026-05-30T19:45:34Z")

</div>

Well, I would be fine with the portion of code below because it was working, however I would like you to figure what is more concise way compared to the code below:

```auto
def create_character (name, strength, intelligence, charisma):

    if not isinstance (strength, int) or not isinstance (intelligence, int) or not isinstance (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'

```

---

<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 30, 2026, 7:51pm UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-shorter-and-more-concise-way-to-validate-stats/790311/2 "2026-05-30T19:51:42Z")

</div>

writing concise code is not the most important thing

code that is too concise will become unreadable

instead you should prefer working and maintainable code, and for code to be maintanable it needs to be easy to read

---

<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:** [June 27, 2026, 7:52pm UTC](https://forum.freecodecamp.org/t/build-an-rpg-character-shorter-and-more-concise-way-to-validate-stats/790311/3 "2026-06-27T19:52:12Z")

</div>

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