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

Output devices, Output Devices Video Display Unit (VDU) or Mo...

Output Devices Video Display Unit (VDU) or Monitor Video Display Unit is similar to a television. It is used to display the results of processes. The screen is il

Describe, Question: a) Illustrate, in detail, what is virtual memory? ...

Question: a) Illustrate, in detail, what is virtual memory? b) The Memory Management Unit is responsible for the translation of virtual addresses to their corresponding phy

Simple batch systems, Simple Batch Systems: Early machines were very...

Simple Batch Systems: Early machines were very expensive, and therefore it was important to maximize machine utilization. To improve utilization, the concept of batch operat

How to find percentage in c++, I have written all formulas fine but still i...

I have written all formulas fine but still its showing 0 as percentage please help me in this program user have to enter obtain score and total score

Analogue and digital signals, Analogue and digital signals: Analogue (c...

Analogue and digital signals: Analogue (continuous) information is made available in virtually all aircraft equipment.  Figure 1 shows the analogue signal created by a variable

Syntax of a Procedure in assembly language, There are two kinds of procedur...

There are two kinds of procedures, the intrasegments, which are found on the similar segment of instructions and the inter-segments which can be stored on dissimilar memory segment

Magnetic core memory, MAGNETIC CORE MEMORY: This type of memory is used...

MAGNETIC CORE MEMORY: This type of memory is used extensively in airborne digital systems, although integrated circuits are being developed with most modern aircraft systems.

Message quality and quantity, Message Quality and Quantity: Quality of...

Message Quality and Quantity: Quality of transmission is a very important .consideration in telecommunication. Voice communication can use a narrow bandwidth, which means the

I/O Stream and Arrays, Write a program that: 1. Ask the user for names of t...

Write a program that: 1. Ask the user for names of the two iput files and a name of an output file. The two input files contain integers in any order. Eachimput file contains no mo

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