Makitweb Posts

A function is a block of code which performs some specific task and returns back to the caller. It has a unique name.

They are helpful when need to perform the same task with different-different values or require to use the same block of code in other places within the program.

If any changes require in the future then only need to update the function code and it will automatically make change where the function it been called.

The main aim of a function is –

  1. To make the program more readable, and organized and,
  2. Reduce repeated code.

How to create function in Python


Loop control statements are used to handling the flow of the loop e.g. terminate the loop or skip some block when the particular condition occurs.

There are following types of loop control statements in Python –

  1. break
  2. continue
  3. pass

Loop control statements in Python


Looping statement is available in the programming language that allows us to repeat a block of code number of times. This reduces coding work and frustration of writing same code multiple times.

They are following types of loops available in Python –

  1. While
  2. for

You can also specify else block with looping statement.

Looping statement in Python


Loop means executing one or more statements up to the desired number of times. Often when you write code, you want the same block of code run over and over…


Logical operators are used to comparing multiple relational expression. In nesting where one if statement within another if statement because of that in the program, there are multiple statements will…


For controlling the flow of the program by making conditions on that basis specific block of code will execute. If the statement is being used for making condition or decision…


Comments are a line of code which is not read and executed as part of the program. It is very useful while editing and debugging the program.


Dictionary in Python is similar to an associative array in PHP.  Dictionary are create using curly braces {} inside it the key is separated with items using a colon (:).…


In Python, a sequence is a set of ordered list. They are differentiated by their index number. The index starts from zero. Two basic types of sequence in Python are list and tuple.


Variables are the temporary placeholder for storing the value which has a unique name. In Python, you don’t need to declare the type of variable, this is done internally according to the value assigned.

Declare a variable in Python