What type of language is python?


Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Let’s understand the paradigms one by one. Paradigms classify programming languages based on their features.

Interpreted Language

Python is processed at runtime by the interpreter. You do not need to compile your program before executing it. This is similar to PERL and PHP.

Steps of Execution

Step 1 − A Python source code is written by the coder. File extension: .py

Step 2 − The Python source code a coder writes is compiled into python bytecode. In this process, a file with the extension .pyc gets created.

Step 3 − The Virtual Machine executes the .pyc extension file. Consider the Virtual Machine is the runtime engine of Python. This is where the Python program runs.

Therefore, the Python Interpreter includes the process of Program Compilation, which in-turn compiles into bytecode, then the execution by Virtual Machine.

Let us see the following illustration to understand the execution process in a better way:


Object-Oriented Language

The Object-Oriented programming language has different components that takes real world objects and performs actions on them, making live interactions between man and the machine.

Object-Oriented includes the following concepts −

  • Encapsulation − Encapsulation is a mechanism of wrapping the data (variables) and code acting on the data (methods) together as a single unit. In encapsulation, the variables of a class will be hidden from other classes, and can be accessed only through the methods of their current class.

  • Class − A class is a user-defined prototype for an object that defines a set of attributes that characterize any object of the class. The attributes are data members and methods, accessed via dot notation.

  • Class variable − A variable that is shared by all instances of a class. Class variables are defined within a class but outside any of the class's methods. Class variables are not used as frequently as instance variables are.

  • Data member − A class variable or instance variable that holds data associated with a class and its objects.

  • Function overloading − The assignment of more than one behaviour to a particular function. The operation performed varies by the types of objects or arguments involved.

  • Instance variable − A variable that is defined inside a method and belongs only to the current instance of a class.

  • Inheritance − The transfer of the characteristics of a class to other classes that are derived from it.

  • Instance − An individual object of a certain class. An object obj that belongs to a class Circle, for example, is an instance of the class Circle.

  • Instantiation − The creation of an instance of a class.

  • Method − A special kind of function that is defined in a class definition.

  • Object − A unique instance of a data structure that's defined by its class. An object comprises both data members (class variables and instance variables) and methods.

  • Operator overloading − The assignment of more than one function to a particular operator.

Updated on: 15-Sep-2022

3K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements