top of page
learn_data_science.jpg

Data Scientist Program

 

Free Online Data Science Training for Complete Beginners.
 


No prior coding knowledge required!

Indentation

Wondering why when we as a kids missed the indentation in the writing class we lost marks?


what is this white space? why is it important?


assume writing different stories in a paper without dividing them into paragraph how can you ever understand that you already finished a story and starting a new one? indentation is the red flag that tells you STOP you are now entering a new clan.


Indentation in Python refers the space at the begging of the statement. The statements with the same indentation belong to the same group called a suite.


Since we are so cool that the interpreter imitates our actions, we understand that these lines are related to each other due to the indentation. Without indentation, Python does not know which statement to execute next or which statement belongs to which block.

Not understanding how indentation works will drive you to see the very famous error


INDENTATIONERROR

If python was not your first stop when learning to code you probably used {} to define your scopes like most of languages like C++ or java.

If you are the type of person who use nested for loops where your "On" is On^5 your code will simply be indented further to the right.


 

IF you understood nothing don't worry the code is coming to rescue you.

statues="Coding is fun"
if statues == "Coding is fun":
    print('passed')
else:
    print('retake the course')
print('Whoohoo ! Lets understand indentation ^_^')

As you see the first print command is indented to the right which makes it belong to the if statues (if the condition is true) execute this command

if not, print the second line.

while the third print command is not indented to the right so it doesn't belong to the else condition so it was printed.

0 comments

Recent Posts

See All

COURSES, PROGRAMS & CERTIFICATIONS

 

Advanced Business Analytics Specialization

Applied Data Science with Python (University of Michigan)

Data Analyst Professional Certificate (IBM)

Data Science Professional Certificate (IBM)

Data Science Specialization (John Hopkins University)

Data Science with Python Certification Training 

Data Scientist Career Path

Data Scientist Nano Degree Program

Data Scientist Program

Deep Learning Specialization

Machine Learning Course (Andrew Ng @ Stanford)

Machine Learning, Data Science and Deep Learning

Machine Learning Specialization (University of Washington)

Master Python for Data Science

Mathematics for Machine Learning (Imperial College London)

Programming with Python

Python for Everybody Specialization (University of Michigan)

Python Machine Learning Certification Training

Reinforcement Learning Specialization (University of Alberta)

Join our mailing list

Data Insight participates in affiliate programs and may sometimes get a commission through purchases made through our links without any additional cost to our visitors.

bottom of page