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

Accessing other computers, Accessing Other Computers The advanced netw...

Accessing Other Computers The advanced networking features of Windows combined with the easy to use user interface make the task of sharing information with other computers/us

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

Ipx for lan, explain ipx for lan and spx

explain ipx for lan and spx

Java programming, what are the phases of oo progarmming or java?

what are the phases of oo progarmming or java?

Choice of medium - transmission channels, Choice of Medium: All the tr...

Choice of Medium: All the transmission channels discussed in the foregoing paragraphs can be used as point to point connections or as broadcast systems. Transmitting informati

Execution of a machine instruction, Execution of a machine instruction: ...

Execution of a machine instruction: Execution of a machine instruction on modern processors involves a complex sequence of operations with multiple cycles. One instruction cyc

Networking.., write advantages and disadvantages of private and public netw...

write advantages and disadvantages of private and public network

Data type, Data Type:  Data Type: Anything that is processed by a comp...

Data Type:  Data Type: Anything that is processed by a computer is called data. There are different types of data that can be given to the computer for processing. A  data typ

C++, Write a C++ program that declares three integers and three strings. Th...

Write a C++ program that declares three integers and three strings. The program prompts the user for three characters and three integers and prints them all on one line.

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