+ 1
Is there a way to control the lines
I've learned CPP before python and in "if statement " of "while" or whatever I knew exactly how much lines in the body I have because I put them between brackets like " if(1) { doSomething(); cout<<something(); cin>>x;} " But in python I'm confused "If 1:"how many of the next lines it will have I can control them in CPP how about python?
4 Réponses
+ 3
if(#something is true):
print("this is in the statement")
print("this too")
print("this not")
+ 2
The body of the ( if statement ) is indicated by the indentation. Body starts with an indentation and the first unindented line marks the end.
+ 1
Thank you