Build an RPG Character - Build an RPG Character

Tell us what’s happening:

i have no idea what is wrong it wont pass any of the tests ive seen similarposts but their code is genreally no different than mine please help!

Your code so far

cfull_dot = '●'
empty_dot = '○'

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

stats = {
    "name": name,
    "strength": strength,
    "intelligence:" intelligence,
    "charisma": charisma
}



if not isinstance= name, str:
    return "The character name should be a string."

    if len(name)>10:
        return "The character nam is too long."
    if name=='': 
        return "the character should have a name"
    if " " in name:
        return "The character name should not contain spaces."

    …
for stat in stats:
    if not isinstance(stat, int):
        return "All stats should be integers"
    if stat<1:
    return "All stats should be no less than 1."
    if stat >4:
    return "All stats should be no less than 4."  
    if sum(stats)!=7
    return "The character should start with 7 points."

    char= (
    f"{name}\n"
    f"STR {full_dot * strength}{empty_dot * (10- strength)}\n"
    f"INT" {full_dot * intelligence}{empty_dot *(10-intelligence)}\n"
    f"CHA {full-dot * charisma}{empty_dot*(10-charisma)}."
    



Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36

Challenge Information:

Build an RPG Character - Build an RPG Character

Hi @C12 , welcome to freeCodeCamp !

First of all, I can see multiples SyntaxError (if you have any errors in your code, every test is gonna say : “Your code raised an error” or something like that)

Have you tried printing the output ? It really helps to have a print() at the bottom of your code.

Just for curiosity, where have you learnt how to use dictionaries ? There is a whole section dedicated for that.

Do you have an error message in your console?

You should address that first.

Okay I’m sorry, I’ll know for next time :confounded_face:

Hi thanks Jarvis i will try that! i have some basic python knowledge gained from books so hence know about dictionarys. Pkdvalis my console just shows wwwww and nothing else thanks again

Isn’t this causing an issue?

Or this stray ellipsis?

Then there’s this.

I’m surprised you are seeing nothing in the console.

Tanks Ive made the changes now just getting indentation error so should be able to solve it, thanks again for your time :slight_smile:

@Jarvis_T
Wasn’t addressing your comment at all. You are correct about the syntax errors

There is a problem with the terminal for now, that could interfere.

When I pasted your code I get this error

  File "main.py", line 25
    …
    ^
SyntaxError: invalid character '…' (U+2026)

When I deleted that line I got this error.

    stats = {
    ^^^^^
IndentationError: expected an indented block after function definition on line 4

If you cannot see these errors, try using a different python editor

You can also see them if you enable night theme.

1 Like