0
how th place of print()affect the output?
I tried this code tones times till I could solve it, and the mistake was ; print() ;was not in the right place https://code.sololearn.com/c3wHGLjnPn32/?ref=app
2 ответов
+ 1
What do you mean it was not in the right place ?
Do you mean the right line ? Then, yeah, Python reads line by line unless you define a func or class that would be called later.
Do you mean the right indentation ? Then also yeah, Python is a programming language that relies on indentation to define beginning and end of sequences (for example you don't need to use brackets or "do; end;" or any "written" charachter to delimit a for loop statement. But instead everything that falls under the for loop should be indented on the right. Else the compiler doesn't know what belongs to the for).
Do you mean something else ?
0
ya I meant the indentation , like if the indentation for print() was like line 2, I will get just the last output that is 10:0