i need to know about intends
What do you mean by
What course is this related to? Please post a link of this course.
im new to python n dont know where intends are taught
whenever my code gets wrong,it shows either a syntax error(which i can correct)or intendation error(which i have no idea)
As we thought,
indentation. That’s the concern of the OP.
Indentation represents a new block. It may or may not have the same scope, but it is a block nonetheless. A branch and a loop generally have their own blocks, and functions of course.
The size of the indent is of no concern, just that it is consistent within the block. Convention has it as four spaces for Python, but two or more are just the same.
x = 1 while x > 0: x += 1 x %= 10 print ('Bye')
The code outside the loop is outer scope, the code inside is still outer scope, but the context is the while block, and remains so until x reaches 10. This relates to execution, even though it is still in outer scope as variables are concerned. The block indentation is what helps Python define this.