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

Explain any five different types of computers, Question 1 Explain any five...

Question 1 Explain any five different types of computers Question 2 Describe Bus Type LAN. Its disadvantages and advantages and examples Question 3 Describe the

Find shortest path in network, Find shortest path from node 1 to node 10 in...

Find shortest path from node 1 to node 10 in the network shown in figure, also find shortest path from node 3 to node 10. Please write all steps to finding shortest path mechanism

Describe the protocol used by the mmu, Question 1: a) A distinction is...

Question 1: a) A distinction is often made between computer architecture and computer organisation. Describe, using examples, the meaning of computer architecture. b) Name

Introduction to Computer and Programming Concept, Classify computer systems...

Classify computer systems according to capacity. How they are different from computers according to the classification of technology. Provide comparative study also.

Compiler, Compiler A compiler is a special program which transla...

Compiler A compiler is a special program which translates programs written in high level language into machine language. The original program is called the source progra

Types of operating systems, Operating Systems:  An operating system is a se...

Operating Systems:  An operating system is a set of programs that manage computer hardware resources and provide common services for application software.  There are following kind

Working of web browser, Working of web Browser:   Internet is character...

Working of web Browser:   Internet is characterized by the Client Server Computing that consists of three basic components: The Web client which may be the web browser;

Program and programming language, Program and Programming Language : ...

Program and Programming Language : A Program is defined as a collection of statements/ instructions that enable the computer to solve a problem. The process of writing a prog

Assembly, can you help me to do my assembly program homework

can you help me to do my assembly program homework

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