Showing posts with label python. Show all posts
Showing posts with label python. Show all posts

Sunday, 28 June 2020

python operator

June 28, 2020

Python Operators:
Operators are the most important aspect of programming languages. All you need to know about operators in programming languages. We have designed this blog beautiful so there should not be any problem but if we are missing something then please let us known in the comments. important python operators are:

1.        Arithmetic operators
2.   Comparison operators
3.   Assignment operators
4.   Logical operators
5.   Bitwise operators
6.   Membership operators
7.   Identity operators

Arithmetic Opera
  •        +                 addition                                                                                   
  •         -                  subtraction
  •         /                  divide
  •         *                  multiplication
  •       %                reminder
  •       **                exponent
  •       //                 floor division


Comparison Operators:
  •         ==               equal to
  •         !=                not equal to
  •         <=               less than equal to
  •         >=               greater than equal to
  •         >                 greater than
  •         <                 less than
  • Assignment Operators:
  •         =                 assign
  •         +=               add and assign
  •         -=                subtract and assign
  •         *=                multiply and assign
  •         %=              remainder and assign
  •         //=               divide and assign
  •         **=              power and assign

Bitwise Operators:
  •         &                 binary and
  •         |                  binary or
  •         ^                 binary xor
  •         ~                 negation
  •         <<               left shift
  •         >>               right shift

Logical Operators:
  •         and
  •         or
  •         not

Membership Operators:
  •         in
  •         not in

Identity Operators:
  •         is
  •         is not


Friday, 26 June 2020

Python Interview Questions

June 26, 2020

Python Interview Questions
A list of top frequently asked python interview questions The answers given below.

·      What is Python?
Python is a high-level object-oriented programming language with objects, modules, threads, exceptions, and automatic memory management. It is a simple yet powerful programming language. It can run equally on different platforms such as Windows, Linux, Macintosh, etc. Thus python is a portable language.
·      What is --int--?
--Int-- is a constructor in python. This constructor is automatically calling to allocate memory when a new object created in a class. All classes have the --int-- constructor.
·      What is the Python Path?
It is an environment variable. Whenever a module is imported, the python path is looking for in the presence of modules in various directions. The interpreter uses it to determine which module to load.
·      What is PEP8?
PEP 8 is a coding convention that specifies a set of guidelines, About how to write your python code more readable. PEP stands for python enhancement proposal. A PEP is an official design document providing information to the Python community, or describing a new feature for python or its processes. PEP is important for document style guidelines for python code.
·      What are Pickling and Unpickling?
Pickle module accepts any Python object and converts it into a string representation and dumps it into a file by using a dump function. This process is called pickling.