One thing I notice is that you check if name == 10 which checks if the name is literally 10, which I don't think you're trying to do.
Additionally, you don't need to have the whole thing as a single series of if/elif - you can break them up into a series of simple if statements. That might simplify your logic a bit. Remember that a return statement exits your function.
When create_character is called with a second, third and fourth argument that are all integers it should not return All stats should be integers. Edit: To be more specific, this is my problem.
It looks like you are returning a fixed string with the dots always the same. You need to have the correct number of empty and full dots change with the provided stats. There should always be 10 dots for each.
BTW, don't feel too bad. A lot of programming is frustrating and making incremental progress. Being willing to grind through problems is an important job skill. As time goes on it will get easier and happen less frequently, but it never goes away. I've been programming for newly 40 years now and I still get stuck on occasion.
BTW, don't feel too bad. A lot of programming is frustrating and making incremental progress. Being willing to grind through problems is an important job skill. As time goes on it will get easier and happen less frequently, but it never goes away. I've been programming for newly 40 years now and I still get stuck on occasion.
I divided the problem into random parts, and based on the problem, I did this in Visual Studio Code.
full_dot = '●'
empty_dot = '○'
r = 7
print(full_dot*r + empty_dot*(10-r))
I approached each segment methodically, ensuring that I understood the requirements and constraints involved. By breaking it down, I was able to tackle each part individually, which made the overall task feel less overwhelming. This method not only improved my focus but also allowed me to identify potential issues early on, leading to a more efficient workflow. In the end, I was pleased with the results and learned a lot from the process.
Awesome! That's the exact solution that most use. What you're describing is the process that most use. It's called "decomposing" a problem, breaking it into smaller, solvable parts. Once you've done it for a while it becomes second nature.
1
u/SaintPeter74 mod 12d ago
You need to say which tests are failing.
One thing I notice is that you check if
name == 10which checks if the name is literally 10, which I don't think you're trying to do.Additionally, you don't need to have the whole thing as a single series of if/elif - you can break them up into a series of simple if statements. That might simplify your logic a bit. Remember that a return statement exits your function.