Semicolon (;) in python

Hey everyone,

If you have done some python code then I guess you may never be used the semicolon in your program. Till now, me neither. Actually, I found that python also supports semicolon but not as a terminator but as a separator. Now, what does this separator mean? Well its nothing but separating multiple statements which written in a single line.
For example :

a = 5
b = 6
c = 7
print(a)
print(b)
print(c)


Now, this all lines can be written as below:

a=5; b=6; c = 7; print(a) ; print(b); print(c)

Wanna make it shorter

a,b,c=5,6,7;print(a,b,c)

That's it. Now I think you get it.
For now, that's from my side. If you want to share something, remember I am waiting...

Comments