Lines and Indentation in python , Basic Computer Science

Assignment Help:
One of the first caveats programmers come across when learning Python is the reality that there are no braces to point to blocks of code for class and function definitions or flow control. Blocks of code are indicated by line indentation, which is strictly enforced.
A number of spaces in the indentation is variable, but all statements in the block must be concave the same amount. Both blocks in this illustration are fine:
if True:
print "True"
else:
print "False"
On the other hand, the second block in this instance will generate an error:
if True:
print "response"
print "True"
else:
print "response"
print "False"
Thus, in Python all the continuous lines indented with same number of spaces would form a block.


Related Discussions:- Lines and Indentation in python

Algorithm, to print first n even numbers

to print first n even numbers

Computers in laboratory organisation and management, Computers can be used ...

Computers can be used for better and more efficient management and organisation of laboratories. A computer like the human brain receives information, stores and processes it and t

Types of operating systems, Operating Systems:  An operating system is a se...

Operating Systems:  An operating system is a set of programs that manage computer hardware resources and provide common services for application software.  There are following kind

Need a help, i am currently studying my computer science engineering 2nd yr...

i am currently studying my computer science engineering 2nd yr. i am unable to select what specification should i take please help me

Types of policy, want to get detail understanding of the types of security ...

want to get detail understanding of the types of security policies including enterprise security policy, issues specific policies etc

What is i-node number, Question 1 Bring out the advantages of Linux Ope...

Question 1 Bring out the advantages of Linux Operating systems Question 2 Match the Symbols with their respective file types              Symbol               File N

Consistency or data in dbms, Consistency or data in DBMS Consistency - da...

Consistency or data in DBMS Consistency - data in DBMS(Database) is accurate in modeling real world, follows integrity constraints User may ensure transaction consistent by itsel

Multiple Statement Groups as Suites, Sets of individual statements making u...

Sets of individual statements making up a single code block are known as suites in Python. Composite or complex statements for example if, def while and class are those which neces

Operating system, Does Process Manager in Operating System know the depende...

Does Process Manager in Operating System know the dependency order that Process A depends on Process B?

Operating systems, Operating Systems: The operating system is the soft...

Operating Systems: The operating system is the software that mediates between the applications programs and a level of instructions nearer to the machine's operations. In othe

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd