First Interaction with Python Basics

SANIA SHINDE
2 min readMar 4, 2022
  • Indents and comments

Indents -

A large portion of the programming languages like C, C++, and Java use { } to characterize the block of code. Python, however, uses indentation. Generally four white spaces are used for indentation and is preferred over tab.

The amount of indentation is up to you, however, it must be steady all through the program. Statements with the same indentation belongs to the same group. The use of indentation makes the code look clean and consistent.

Comments -

Comments are significant while composing a program.In Python, comments are a set of statements that are ignored by the Python Interpreter i.e. they are non executable statements. We use comments because it makes it easy for us to understand the source code.

  • Variables in Python

Comments are significant while composing a program.In Python, comments are a set of statements that are ignored by the Python Interpreter i.e. they are non executable statements. We use comments because it makes it easy for us to understand the source code.We don’t need to declare explicitly variable in Python. When we assign any value to the variable, that variable is declared automatically.

The equal (=) operator is used to assign value to a variable.

>>> var = 23.5

>>> print(var)

23.5

>>> var = “Now I’m a string”

>>> print(var)

Now I’m a string

Reserved Words (Keywords)

The Python language reserves a small set of keywords that designate special language functionality. No object can have the same name as a reserved word.

Python Keywords -

--

--