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

Discuss on browsers for cloud computing, Question 1 Discuss on "Platform a...

Question 1 Discuss on "Platform as a Service" Question 2 Write a note on Accounting Services Question 3 Explain the different Software clients Question 4 D

Discuss the roles of system analysts in detail, Question 1 Explain the ...

Question 1 Explain the following system design tools in detail System Flowcharts Decision tables Decision trees Organization charts Question 2 Write s

Algorithms and psuedocodes, write an algorithm and psuedo code for the oper...

write an algorithm and psuedo code for the operation of the cramer`s rule

Artificial interlligence, 7. Name and explain the action in Conceptual Depe...

7. Name and explain the action in Conceptual Dependency which refers to a transfer of possession.

Historical background of computers, Historical Background The br...

Historical Background The brief history of the growth of computers is given below: Abacus:   It was the first mechanical device developed approximately 3,000 year

Input devices of a digital computer, Input devices of a digital computer: ...

Input devices of a digital computer: Input devices are used to read the instructions and data to be processed and output devices display the results obtained after executing t

Problem occurs during pipelining , While pipelining can cruelly cut the tim...

While pipelining can cruelly cut the time taken to execute a program, there are troubles that cause it to not work as well as it possibly shall. The three stages of the instruction

Global positioning system, How does GPS work in the field of Sport or athle...

How does GPS work in the field of Sport or athletics?

Assigment, how to measure marginal utility.?

how to measure marginal utility.?

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