+ 2
Why and when is colon used in program
If question
15 Antworten
+ 1
if 3>2:
print 3
else :
print 2
+ 1
Read python course.It is so helpful😉
+ 1
Does it work like ; in C++
+ 1
Nope Sameer
+ 1
Thanks
+ 1
if(3>2)
cout <<3; // the space before the cout is not important
else // we don't use : after if or else
cout <<2; //
+ 1
The writing is different ,but the idea and way same.
+ 1
So in print() colon is not required
+ 1
You can say print() like cout in c++
+ 1
Most welcome Sameer
+ 1
No I meant after print("abc") colon is not required
+ 1
Yes the colon after the print is not required
+ 1
Ok thanks
+ 1
Welcome ask here as you like brother we are brothers 😉😉