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

Microsoft office, Finding someone who doesn''t use some aspect of Microsoft...

Finding someone who doesn''t use some aspect of Microsoft Office on a daily basis is difficult. Whether it is Outlook for email,Word for creating and editing documents,or Excel f

Normalization, how we come to know about primary key,if more than ids gathe...

how we come to know about primary key,if more than ids gather?

Artificial intelligence-internal structure of agents, Internal Structure of...

Internal Structure of Agents We have looked at agents in conditions of their outside influences and behaviors: they take effort from the atmosphere and do lucid actions to chan

System, differance between multiaccess and multitasking

differance between multiaccess and multitasking

Indexing a page on internet, Indexing a page on internet: Once, the sp...

Indexing a page on internet: Once, the spiders have completed the task of finding information about Web pages, the search engine must store the information in such way that yo

Characteristics of artificial intelligence, Characteristics of Artificial I...

Characteristics of Artificial Intelligence: Artificial Intelligence is not an easy science to describe, as it has fuzzy borders with simulation mathematics, computer science t

Assignment Help, How would you format while loops to fufill my project writ...

How would you format while loops to fufill my project write up?

Input devices, Input Devices Keyboard Keyboard is the dev...

Input Devices Keyboard Keyboard is the device through which the commands, instructions required for execution of a program is entered. It consists of a number of

Visual Basic, difference between genral and event procedures

difference between genral and event procedures

Goals of autonomous rational agents, Goals of Autonomous Rational Agents: A...

Goals of Autonomous Rational Agents: Artificial intelligence One possible way to improve an agent's performance is to enable it to have some kind of details about what it is tr

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