Python | New and Override Modifiers The new modifier is used to instruct the compiler to use the new implementation and not the base class function. The Override modifier is useful for overriding a base class …

Last updated 1 year, 10 months ago | 1116 views

Tags:- Python

Negative indexes mean that you count from the right instead of the left. So, list[-1] refers to the last element, list[-2] is the second-last, and so on.

Last updated 1 year, 10 months ago | 429 views

Tags:- Python

Python | Access Specifiers Python does not make use of access specifiers specifically like private, public, protected, etc. However, it does not derive this from any variables. It has the concept of imitating the behavior of …

Last updated 1 year, 10 months ago | 425 views

Tags:- Python

Yes, it is possible if the base class is instantiated by other child classes or if the base class is a static method.

Last updated 1 year, 10 months ago | 474 views

Tags:- Python

Python | *args and **kwargs  *args is a special syntax used in the function definition to pass variable-length arguments. e.g: myFun(*argv) def func(*args): for i in args: print(i) func(2,3,4) #Output 2 3 4   **kwargs is …

Last updated 1 year, 10 months ago | 386 views

Tags:- Python

Python | split() and join() You can use split() method to split a string based on a delimiter to a list of strings. and join() method is used to join a list of strings based on …

Last updated 1 year, 10 months ago | 443 views

Tags:- Python

Python | Delete a file Using command  os.remove(file_name)   Use the os module to delete a file, we need to first import it, and then use the remove() function provided by the module to delete the file. It …

Last updated 1 year, 10 months ago | 438 views

Tags:- Python

Python | vars(), dir() and help()  The vars() function returns the __dict__ attribute of an object. The dir() function returns all properties and methods of the specified object, without the values. The help() function is used to display …

Last updated 1 year, 10 months ago | 418 views

Tags:- Python

Python | PYTHONPATH  PYTHONPATH is an environment variable that you can set to add additional directories where Python will look for modules and packages. This is especially useful in maintaining Python libraries that you do not wish …

Last updated 1 year, 10 months ago | 398 views

Tags:- Python

Python | Break, Continue, and Pass Break: The break statement terminates the loop immediately and the control flows to the statement after the body of the loop. Continue: The continue statement skips the current iteration of the statement, …

Last updated 1 year, 10 months ago | 401 views

Tags:- Python

Python | __init__  constructor method __init__ is a constructor method in Python and is automatically called to allocate memory when a new object/instance is created. All classes have a __init__ method associated with them.   class Student: …

Last updated 1 year, 10 months ago | 396 views

Tags:- Python

Python | Self Self is used to represent the instance of the class. With this keyword, you can access the attributes and methods of the class in python. It binds the attributes with the given arguments.   …

Last updated 1 year, 10 months ago | 359 views

Tags:- Python

Python | Global, Protected, and Private Global, Protected, and Private access modifiers in Python. Python does not use these keywords to control access modifications instead single and double underscore  ‘_’ symbols are used to specify Protected and  Private to determine the access control. …

Last updated 1 year, 10 months ago | 448 views

Tags:- Python

Python | Pass Statement The pass statement is used as a placeholder for future code. It represents a null operation in Python. It is generally used for the purpose of filling up empty blocks of …

Last updated 1 year, 10 months ago | 391 views

Tags:- Python

Python | lists, and tuples Lists and Tuples both are sequence data types that can store a collection of objects in Python. They are both heterogeneous data types means that you can store any kind of …

Last updated 1 year, 10 months ago | 474 views

Tags:- Python