While they are hardly ever used, semi-colons are still valid syntax in Python.
In Python, semicolons can be used to separate multiple statements that are placed on the same line, however this may make the code cumbersome to read.
>>> sq = lambda x: x ** 2; print(sq(7)); print(sq(8)); print(sq(9)) 49 64 81
Love your example, Glenn. Well chosen, and it makes a good point.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.