Statements

Statement is a unit of code that Python interpreter can execute. So far we’ve used two kinds of statements: print and assignment. When you type a statement in Python interactive mode, the interpreter executes it and displays the result, if there is one. When you execute a Python script there is usually more than one statement (sequence of statements). If there is more than one statement, the result appear one at a time as the statements execute.
For example, this script
print 55 
x= 245
print x
Will produce the output:
55
245


As you can see from previous script the print statement produces output while assignment statement produces no output at all.

Nema komentara:

Objavi komentar