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

What features should the hospital software contain?, What Features Should t...

What Features Should the Software Contain? Although the needs of every nursing department, hospital, pharmacy, would vary, certain common features are desirable in the software

Fms control-display unit, FMS CONTROL-DISPLAY UNIT: The CDU provides a ...

FMS CONTROL-DISPLAY UNIT: The CDU provides a means for the crew to communicate with the FMC.  It contains pushbutton key controllers and a display screen.  The keys are of two

Random access memory (ram), RANDOM ACCESS MEMORY (RAM): The RAM-type me...

RANDOM ACCESS MEMORY (RAM): The RAM-type memory will allow data to be written into it, as well as read from it. With very few exceptions, RAMS lose their contents when the powe

Input - output services, Input/Output Services:   Every operating syst...

Input/Output Services:   Every operating system, large or small, provides input/output services for each device in the system. The operating system includes I/O device driver

How Round robin scheduling algorithm is useful than others ?, Round robin (...

Round robin (RR) is one of the simplest, oldest, fairest and most extensively used algorithms. • In the round robin scheduling, processes are posted in a FIFO manner but are given

The internet or the world wide web, The internet or the World Wide Web is ...

The internet or the World Wide Web is the most familiar and popular example. These databases hold vast amounts of information, for example, on companies. By obtaining details in t

IF.ELSE Statement of python , Conditional constructs are used to integrate ...

Conditional constructs are used to integrate decision making into programs. The outcome of this decision making determines the series in which a program will execute instructions.

What is raid?explain its levels, Question 1 What is fabric login and what ...

Question 1 What is fabric login and what are its functions Question 2 Explain how is IP SAN different from SAN Question 3 Discuss the product related to Fibre Channel Questio

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