Python Refresher - mistake in code comment

Look in notebook 2nd to last module in Python Refresher. Comment aligned to code is off.

t.append(layout_string) # Add a new line character at the end << —–PROBLEM

The above comment is very misleading. That adding of a new line doesn’t’ happen until he join below this.

i am not clear what you are confused about?

the t is getting appended to layout string, and the instructions is actually mentioning that step.

Also when post a query briefly mention from what section, lab, assignment name, if it is graded or upgraded, exercise name, when you are raising a query.

Deepti -

No question.

Point: The Python Refresher curriculum has a mistake in the comments section.

Step 1. Go to Python Refresher in Module one of RAG course.

Step 2. Search (perform a Find) on this string: “Add a new line character at the end”

Step 3. Change or remove the comment. It is at the wrong line.

Thanks,

AO

1 Like

@Yoda_AO

if t is a list, array, or similar data structure that is accumulating multiple strings or lines of text.
append is a method used to add an item to the end of the list t.

layout_string is the variable holding the actual content that is being added.

So based on the comment (“Add a new line character at the end”). The layout_string is part of a sequence of strings being assembled, possibly to format a document or data file.

So it’s building a collection of formatted text lines one by one and that comment mentioning the same above step in a single comment.

Regards
DP

There is a comms issue here.

1 Like

@lucas.coutinho

can you please look at the learner’s query

I have explained him why that comment was mentioned with the code, but he insists on the issue.

Regards

DP