Learn Python syntax






Part 1

Python Indentation


Indentation are the spaces at the beginning of a python code line.



tip: In other programming languages, spaces before code line is for readability only



Code Example:

if 6 > 3:
dd print("Six is greater than Three!")







if you skip the indentation, Python will show you an error:


Code Example:

if 6 > 3:
print("Six is greater than Three!")





tip: Use atleast 1 space, but you can use more.



tip: You should use the same number of spaces in the same code block, or Python will give you an error.




tip: A Python program is read by a parser. Originally Python was designed to be very readable language




Comments in Python


Check out our Python comments lesson.







Part 2

Python Variables




In Python variables are created when you assign a value to it:


Code Example:

x = 8
y = "Free code wiki!





learn Python courses and many other Coding lessons for free , our main goal is to allow students to learn Python and other online Programming courses in one place for free.

Navigation