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

Software design, Ineed help to do my homework which is for designing of req...

Ineed help to do my homework which is for designing of requirenments.

Image processing, Image Processing: This technology is quite advanced ...

Image Processing: This technology is quite advanced and devices are now available for routine scanning and storage of printed pages, graphics, etc., which can then be retrieve

Quiz for your learning activity, The development of your learning module is...

The development of your learning module is very time consuming, so it is recommended that you begin creating your learning module during this first week. Before you begin, download

ICT IN BUSINESS, Explain how ICT can be used for achievement of each of the...

Explain how ICT can be used for achievement of each of the following business objectives, illustrating your answer with examples: 1. Customer intimacy 2. Low-cost leadership

Javascript, Need help with javascript sb.append questions

Need help with javascript sb.append questions

C, A palindrome is a string that reads the same from both the ends. Given a...

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Overview of a computer system, Overview of a Computer System The...

Overview of a Computer System There are three major elements in every computer solution. They are:     Data     Hardware     Software Hardware + Softwa

Hypertext markup language (html), HTML is a Formatting language which is mo...

HTML is a Formatting language which is most commonly used for web documents.

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