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

Number system, convert the following in to binary 108

convert the following in to binary 108

Library function, Library function :   These are the functions supplied...

Library function :   These are the functions supplied with the programming language. The code or definition of library functions does not have to be written in a user program w

Files, definition of file operations

definition of file operations

Search strategy-artificial intelligence, Search strategy-artificial intelli...

Search strategy-artificial intelligence: Soundness: You  can hear  in  some  application domains  -  i.e.  automated  theorem proving - that a search is "sound and complet

Bidirectional search-artificial intelligence, Bidirectional Search-Artifici...

Bidirectional Search-Artificial intelligence: We've concentrated so far on searches where the point of the search is to search a solution, not the path to the solution. In anot

Ipx for lan, explain ipx for lan and spx

explain ipx for lan and spx

What is atm cell, Header contains routing and error control information Pay...

Header contains routing and error control information Payload carries the actual user information, either voice, data or video

Circuit switching and , Circuit Switching: Many switching techniques a...

Circuit Switching: Many switching techniques are in use. One of them is line or circuit switching in which a communications path is actually established before the message is

Digital wireless telephone networks, Mobile telephone networks started with...

Mobile telephone networks started with analog technology. Analog cellular networks were known as first generation (1G) networks. Such networks had limited capacity, and were subjec

General considerations for search - artificial intelligence, General Consid...

General Considerations for Search If we may specify the starting state, the operators and the goal check for a search problem, then we know from where to start, how to move and

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