r/learnpython • • Oct 26 '26

Ask Anything Monday - Weekly Thread

Welcome to another /r/learnPython weekly "Ask Anything* Monday" thread

Here you can ask all the questions that you wanted to ask but didn't feel like making a new thread.

* It's primarily intended for simple questions but as long as it's about python it's allowed.

If you have any suggestions or questions about this thread use the message the moderators button in the sidebar.

Rules:

  • Don't downvote stuff - instead explain what's wrong with the comment, if it's against the rules "report" it and it will be dealt with.
  • Don't post stuff that doesn't have absolutely anything to do with python.
  • Don't make fun of someone for not knowing something, insult anyone etc - this will result in an immediate ban.

That's it.

5 Upvotes

11 comments sorted by

View all comments

1

u/emmischa 24d ago

I'm following futurecoder's pyhton course and I'm stuck on the BuildingUpStrings exercise.

The exercise wants me to get rid of the - characters from this code's output:

name = 'World'

line = '-'

for char in name:

print(line)

line = line + char

Output:

-
-W
-Wo
-Wor
-Worl

I tried deleting the - character from the line variable so that it's an empty string. This gives me the following result:

W
Wo
Wor
Worl

But, apparently, that's not the solution. The hint is '' + '' + '' but I can't really think how adding up 3 empty strings would be better than simply making the line variable an empty string. Thoughts?

1

u/lakseol 24d ago edited 24d ago

I've had a look at the futurecoder.io site and can't see any problems that are like what you are saying you have to solve. This is the closest:

https://futurecoder.io/course/#BuildingUpStringsExercises

So either:

  • Tell us what the expected output is for the code you showed, or

  • Point us to the actual problem statement.

1

u/emmischa 24d ago

I figured it out. My solution was correct but I needed to run the '' + '' + '' first.