← Intro to programming with Python
Mini project: an event poster
Put print() and comments together to make a neat poster.
A project is where separate skills meet. Before typing, picture the result: what goes on line one, line two, and so on. Then write one print() per line, and add a comment for each part so the plan is visible in the code. Planning first saves time, because you know what "done" looks like.
# Top border
print("**************")
# Details
print("Book Swap")
print("Library, 3 pm")
# Bottom border
print("**************")Four print() lines make four lines of poster. The comments mark the parts but do not show up.
Common mistake: mismatched quotes, like print("Book Swap'). Start and end the text with the same kind of quote.
An empty print() shows a blank line, which is useful for spacing.