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

Advantages and disadvantages of e-learning, Advantages and Disadvantages of...

Advantages and Disadvantages of E-Learning: Before we discuss about advantages and disadvantages of e-learning, you should know that e-learning is just another model for learn

Define Multilevel Queue Scheduling?, • A multilevel queue scheduling algori...

• A multilevel queue scheduling algorithm divides the ready queue in several separate queues, for example • In a multilevel queue scheduling processes are lastingly assigned to one

Explain with diagram the internal components of alu, Problem 1. Explain...

Problem 1. Explain with diagram the internal components of ALU. Diagram Explaining Internal components 2. What is addressing mode? Explain any five addressing mo

Special-purpose and general-purpose computers, SPECIAL-PURPOSE AND GENERAL-...

SPECIAL-PURPOSE AND GENERAL-PURPOSE COMPUTERS In general, there are two types of digital computers. The first is the special-purpose digital computer, which performs a f

Memory of computer, Memory : Computers store information internally as wel...

Memory : Computers store information internally as well as externally. Linked to CPU is an internal memory unit where all the instructions and data are stored. It contains the

CAI, What is CAI? Explain its pitfalls.

What is CAI? Explain its pitfalls.

Why is the atm selected as a transport network in 3g, Why is the ATM select...

Why is the ATM selected as a transport network in 3G? Answer: ATM provides efficient support for transmission of voice, data, and video ATM provides QoS guarantee and reliability

Definition of resource sharing , Resource sharing is a concept which has de...

Resource sharing is a concept which has developed to contain many cooperative activities among libraries and other stakeholders. Interlibrary loan continues to be the basis of reso

Data transmission, Data transmission: Most digital communication data i...

Data transmission: Most digital communication data is transmitted in a serial form, that is, only one bit at a time. Transmission of data in serial form means each bit is tran

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