Python Interview Questions | Eklavya Online

Python Interview Questions

How Python does Compile-time and Run-time code checking?

In Python, some amount of coding is done at compile time, but most of the checking such as type, name, etc. are postponed until code execution. Consequently, if the Python code references a user-defined function that does not exist, the code will compile successfully. The Python code will fail only with an exception when the …

How Python does Compile-time and Run-time code checking? Read More »

What is Python?

Python was created by Guido van Rossum, and released in 1991. It is a general-purpose computer programming language. It is a high-level, object-oriented language which can run equally on different platforms such as Windows, Linux, UNIX, and Macintosh. It is widely used in data science, machine learning and artificial intelligence domain. It is easy to …

What is Python? Read More »

What is the Python decorator?

Decorators are very powerful and a useful tool in Python that allows the programmers to modify the behaviour of any class or function. It allows us to wrap another function to extend the behaviour of the wrapped function, without permanently modifying it. # Decorator example def decoratorfun(): return another_fun Functions vs. Decorators A function is …

What is the Python decorator? Read More »

What is the usage of enumerate () function in Python?

The enumerate() function is used to iterate through the sequence and retrieve the index position and its corresponding value at the same time. For i,v in enumerate([‘Python’,’Java’,’C++’]): print(i,v) 0 Python 1 Java 2 C++ # enumerate using an index sequence for count, item in enumerate([‘Python’,’Java’,’C++’], 10):

What are the applications of Python?

Python is used in various software domains some application areas are given below. Web and Internet Development Games Scientific and computational applications Language development Image processing and graphic design applications Enterprise and business applications development Operating systems GUI based desktop applications Python provides various web frameworks to develop web applications. The popular python web frameworks …

What are the applications of Python? Read More »

What are the rules for a local and global variable in Python?

In Python, variables that are only referenced inside a function are called implicitly global. If a variable is assigned a new value anywhere within the function’s body, it’s assumed to be a local. If a variable is ever assigned a new value inside the function, the variable is implicitly local, and we need to declare …

What are the rules for a local and global variable in Python? Read More »