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

Data mining, Process of Data mining Data mining is an iterative process t...

Process of Data mining Data mining is an iterative process that typically involves the following phases: Problem definition A data mining project starts with the understanding o

Basic, WAP TO ACCEPT MARKS OF THREE SUBJECT FOR STUDENT & CALCULATE TOTAL M...

WAP TO ACCEPT MARKS OF THREE SUBJECT FOR STUDENT & CALCULATE TOTAL MARKS AND PERCENTAGE

Microprocessor, what is computer mapped input / output

what is computer mapped input / output

Assignment, Assignment of computer science

Assignment of computer science

Computer input, COMPUTER INPUT: Figure shows input information for a ty...

COMPUTER INPUT: Figure shows input information for a typical airborne digital computer.  The sensors in Figure develop analogue electrical signals representing: -

Overview of a computer system, Overview of a Computer System The...

Overview of a Computer System There are three major elements in every computer solution. They are:     Data     Hardware     Software Hardware + Softwa

Database management, what is the sql command to List all the join condition...

what is the sql command to List all the join conditions or join paths (pairwise) existing between tables.

Computer graphics, A scaling constant indicates an expansion of length

A scaling constant indicates an expansion of length

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