I am currently trying to rewrite my code in a more complicated way. I will leave the bug report here, though:
Dear freeCodeCamp Support, thank you for taking your time to read this. I think there is a bug in your Python interpreter. I am currently doing /learn/python-v9/lab-rpg-character/build-an-rpg-character and I have noticed that when I print("Wordy Words", end="", the terminal output is Wordy Words [object Object] and the next print() function will still print on a new line. Now, [object Object] is a JavaScript thing. And when I run my code in Thonny, the result is as intended.
Here is my code:
Click to expand
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 not name:
return "The character should have a name"
if len(name) > 10:
return "The character name is too long"
if " " in name:
return "The character name should not contain spaces"
if not (isinstance(strength, int) and isinstance(intelligence, int) and isinstance(charisma, int)):
return "All stats should be integers"
if strength < 1 or intelligence < 1 or charisma < 1:
return "All stats should be no less than 1"
if strength > 4 or intelligence > 4 or charisma > 4:
return "All stats should be no more than 4"
if strength + intelligence + charisma != 7:
return "The character should start with 7 points"
print(name + " \nSTR ", end="")
for i in range(strength):
print(full_dot, end="")
remaining = 9-i
for i in range(remaining):
print(empty_dot, end="")
print("\nINT ", end="")
for i in range(intelligence):
print(full_dot, end="")
remaining = 9-i
for i in range(remaining):
print(empty_dot, end="")
print("\nCHA ", end="")
for i in range(charisma):
print(full_dot, end="")
remaining = 9-i
for i in range(remaining):
print(empty_dot, end="")
create_character('ren', 4, 2, 1)
freeCodeCamp terminal output:
Click to expand
ren
STR [object Object]
● [object Object]
● [object Object]
● [object Object]
● [object Object]
○ [object Object]
○ [object Object]
○ [object Object]
○ [object Object]
○ [object Object]
○ [object Object]
INT [object Object]
● [object Object]
● [object Object]
○ [object Object]
○ [object Object]
○ [object Object]
○ [object Object]
○ [object Object]
○ [object Object]
○ [object Object]
○ [object Object]
CHA [object Object]
● [object Object]
○ [object Object]
○ [object Object]
○ [object Object]
○ [object Object]
○ [object Object]
○ [object Object]
○ [object Object]
○ [object Object]
○ [object Object]
Thonny shell output:
Click to expand
>>> %Run test.py
ren
STR ●●●●○○○○○○
INT ●●○○○○○○○○
CHA ●○○○○○○○○○
>>>
Thanks in advance for your response,
hiitsmeiguess Wednesday, the 13th of May, 2026 at 12:21
Edit:
Here is the console output (the console in the lab editor, not the browser console):
Click to expand
// running tests
18. create_character('ren', 4, 2, 1) should return ren\nSTR ●●●●○○○○○○\nINT ●●○○○○○○○○\nCHA ●○○○○○○○○○.
19. When create_character is called with valid values it should output the character stats as required.
// tests completed
// console output
CHA ●●●●○○○○○○ren
STR ●●●●○○○○○○
INT ●●○○○○○○○○
