Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building Up Strings Exercises - Not accepting a working solution #420

Open
itpropaul opened this issue Jan 27, 2023 · 1 comment
Open

Building Up Strings Exercises - Not accepting a working solution #420

itpropaul opened this issue Jan 27, 2023 · 1 comment

Comments

@itpropaul
Copy link

For this challenge:

You're getting good at this! Looks like you need more of a challenge...maybe instead of putting a name in a box, the name should be the box? Write a program that outputs this:

+World+
W     W
o     o
r     r
l     l
d     d
+World+

I wrote the following code:

name = 'World'
nameWPluses = '+' + name + '+'
print(nameWPluses)
for char in name:
    char = char + '     ' + char
    print(char)
print(nameWPluses)

And my output matches the expected solution (including prompt at the very end):

+World+
W     W
o     o
r     r
l     l
d     d
+World+
>>> 

And while the code works, it doesn't accept the solution. The debugger makes it look as if there are too many spaces, then when I remove one of the five spaces, the debugger shows that it doesn't have enough.

After looking at the first hint, I noticed that you're expecting a for loop to be used to build up the 5 spaces, that's what I'll work next, but regardless wanted to report this.

@alexmojaki
Copy link
Owner

Thanks for your feedback!

Here's what I see and what I expect you also see:

Screenshot from 2023-01-27 23-59-40

The debugger makes it look as if there are too many spaces, then when I remove one of the five spaces, the debugger shows that it doesn't have enough.

I assume that by the debugger, you're referring to the 'Assessment' section. Basically it's telling you that even though your code works for name = 'World' it doesn't work for name = 'Bob'. Note the last sentence of the 'Requirements' section:

Your code will be tested automatically with different values to check that it works generally.

Otherwise, you could just submit this:

print('+World+')
print('W     W')
... etc

This type of confusion used to be a lot more common as the interface didn't really explain things properly. The 'Requirements' and 'Assessment' sections are quite new and were part of a major overhaul to solve this kind of problem. Do you have any ideas how it could be improved/clarified further? This isn't the first time I hear from someone still confused by the new interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants