0

Can we use ';' as end of statement in phython?

20th May 2017, 9:39 AM
sai charan tej
sai charan tej - avatar
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.
20th May 2017, 11:47 AM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar
+ 2
Yes you can. You can use newline or ';' to separate statements.
20th May 2017, 9:47 AM
Ulisses Cruz
Ulisses Cruz - avatar