0
Can we use ';' as end of statement in phython?
2 Answers
+ 9
If you want to give instructions in the same line, you may use the semicolon. However, it is not considered very Pythonic and its use is being discouraged.
I rarely use it - in if statements where there is only one simple instruction like print(x) or x += 1
But for better code clarity it's wisest to make a new, one-line syntactic block.
+ 2
Yes you can. You can use newline or ';' to separate statements.