All Questions

Python

Follow
Showing 51 - 60 out of 173 Questions
303 Views

What advantages do NumPy arrays offer over (nested) Python lists?

Nitin Mereddy 24th Oct, 2021

Nested Lists :

  • Python lists are efficient general-purpose containers that support efficient operations like insertion,appending,deletion and concatenation.
  • The limitations of lists are that they don’t support “vectorized” operations like element wise addition and multiplication, and the fact that they can contain objects of differing types mean that Python must store
619 Views

Whenever Python exits, why isnt all the memory de-allocated?

Nitin Mereddy 24th Oct, 2021

Whenever Python exits, especially those Python modules which are having circular references to other objects or the objects that are referenced from the global namespaces are not always de-allocated or freed.

It is not possible to de-allocate those portions of memory that are reserved by the C library.

On exit,

108 Views

What do file-related modules in Python do? Can you name some file-related modules in Python?

Nitin Mereddy 24th Oct, 2021

Python comes with some file-related modules that have functions to manipulate text files and binary files in a file system. These modules can be used to create text or binary files, update their content, copy, delete, and more.

Some file-related modules are os, os.path, and shutil.os. The os.path module has

36 Views

Is indentation required in Python?

Nitin Mereddy 24th Oct, 2021

Indentation in Python is compulsory and is part of its syntax.

All programming languages have some way of defining the scope and extent of the block of codes. In Python, it is indentation. Indentation provides better readability to the code, which is probably why Python has made it compulsory.

88 Views

What is type conversion in Python

Nitin Mereddy 24th Oct, 2021

Python provides you with a much needed functionality of converting one form of data type into the  needed one and this is known as type conversion.

Type Conversion is classified into types:

1.Implicit Type Conversion: In this form of Type conversion python interpreter helps in automatically converting the data type

72 Views

What are local variables and global variables in Python?

Nitin Mereddy 24th Oct, 2021

Local variable : Any variable declared inside a function is known as Local variable and it’s accessibility remains inside that function only.

Global Variable : Any variable declared outside the function is known as Global variable and it can be easily accessible by any function present throughout the program.

154 Views

What are the common built-in data types in Python?

Nitin Mereddy 24th Oct, 2021

Python supports the below-mentioned built-in data types:

Immutable data types:

  • Number
  • String
  • Tuple

Mutable data types:

  • List
  • Dictionary
  • set
48 Views

What is __init__ in Python explain its significance

Nitin Mereddy 24th Oct, 2021

Equivalent to constructors in OOP terminology, __init__ is a reserved method in Python classes. The __init__ method is called automatically whenever a new object is initiated. This method allocates memory to the new object as soon as it is created. This method can also be used to initialize variables.

533 Views

What is scope resolution in python Language

Nitin Mereddy 24th Oct, 2021

A scope is a block of code where an object in Python remains relevant.Each and every object of python functions within its respective scope.As Namespaces uniquely identify all the objects inside a program but these namespaces also have a scope defined for them where you could use their objects without

224 Views

Explain Inheritance in Python with an example?

Nitin Mereddy 24th Oct, 2021

As Python follows an object-oriented programming paradigm, classes in Python have the ability to inherit the properties of another class. This process is known as inheritance. Inheritance provides the code reusability feature . The class that is being inherited is called a superclass or the parent class, and the class

The question have been saved in answer later, you can access it from your profile anytime. Access now