I thought every line in pythton is a statment, but have a look below:
class Report(p.Report):
def create(self):
self.set(background=sp.LightYellow)
self.add(p.Row(p.Text("Trip Name",
valign=p.CENTER,
font=p.font(weight=p.BOLD)),
p.Column(p.Text("Costs",
align=p.CENTER)))
I thought we are not allowed to get to next line unless the statement is ended. It writes valign = p.CENTER in the next line. How is it possible? How can we break a line and continue the statement in the next line?
It has also written p.Column in another line, but it has the same indent with p.Row, is it a rule?
Put simply, a statement can continue on to the next line as long as there is an open parenthesis or bracket or brace.
Valid:
Invalid: