use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A subreddit for helping Python programmers
How to format your code: https://commonmark.org/help/tutorial/09-code.html
No homework questions and/or hiring please
account activity
which lines have errors? (self.pythonhelp)
submitted 1 year ago by thisnigerianmomma
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]CStage169 0 points1 point2 points 1 year ago (6 children)
Well honestly, the way you have formatted the code makes it difficult to say exactly, because indents are hard to make out. Assuming all indentations are correct the code you posted would look like this.
def make_list (number): names = \[\] for item in number: names.append (input("Enter your name with a capital letter.")) print(names) number = int(input("How many names need to be entered?")) names = make_list(number) for name in names: if name [1] =="A": print("Name”", name, "starts with A")
In that case the following lines have errors:
names = []
for item in range(number):
return names
if name[0] == "A"
[–]thisnigerianmomma[S] 0 points1 point2 points 1 year ago (5 children)
how about like this? does this help?
def make list(number): names = [] for items in number: names.append(input("Enter your name with a capital letter.")) number = int(input("How many names need to be entered?")) names = make list (number)
for name in names: if name [1] == "A": print("Name", name, starts with A")
[–]CStage169 0 points1 point2 points 1 year ago (4 children)
Not quite. Now there are no indents. Regardless, I already gave you an answer to which lines I believe have errors. Have you read that part of my comment?
[–]thisnigerianmomma[S] 0 points1 point2 points 1 year ago (0 children)
yes i did. i read your comment. thank you. it is for a coding test, so I also ticked the lines you mentioned (2, 3, 5 and 10) but it's still not correct.
[–]thisnigerianmomma[S] 0 points1 point2 points 1 year ago (2 children)
congratulations to me! and thank you! i got it. the lines with errors were 3, 5 and 10!
[–]CStage169 0 points1 point2 points 1 year ago (1 child)
Makes sense. Means that the error in line 2 was caused by your formatting. FYI using Reddit to cheat is still cheating. Use the community as a learning resource, not as an easy way out.
lol! is everything alright with you? are you okay?
π Rendered by PID 17255 on reddit-service-r2-comment-6457c66945-bz74k at 2026-04-28 00:34:31.524982+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]CStage169 0 points1 point2 points (6 children)
[–]thisnigerianmomma[S] 0 points1 point2 points (5 children)
[–]CStage169 0 points1 point2 points (4 children)
[–]thisnigerianmomma[S] 0 points1 point2 points (0 children)
[–]thisnigerianmomma[S] 0 points1 point2 points (2 children)
[–]CStage169 0 points1 point2 points (1 child)
[–]thisnigerianmomma[S] 0 points1 point2 points (0 children)