CodeSteps

Python, C, C++, C#, PowerShell, Android, Visual C++, Java ...

Understanding Constructors and Destructors in Python

In Python, constructors and destructors are special methods used to initialize and clean up objects of a class. Constructor: __init__ Method The constructor in Python is defined using the __init__ method. It is automatically called when a new object of the class is created. For example, # Vehicle.py class Vehicle: def __init__(self, type, color): self.type […]

PowerShell – Automatic Variables – $HOST, $HOME, $PWD and $ERROR

PowerShell provides another set of Automatic variables to allow us to get the information about the home directory, present working directory, host details, and error details. In this article, we will discuss these variables. The $HOST Automatic Variable This variable contains the current host application object for PowerShell. Below displays the details of the host […]

C# – How to use string interpolation?

String interpolation is useful to create formatted strings in a more readable form. C# uses the symbol “$” to represent the given string as an interpolated string. String interpolation allows us to use the variables within the string, and variables will be replaced with the actual values at the time of execution. This gives better […]

Python – Customize Truth Value testing

We have discussed Truth Value testing in our previous Articles “Python – Truth Value Testing” and “Python – Truth Value Testing for Class objects“. Through this article, we will discuss customizing Truth Value testing. We can customize Truth value testing by defining __bool__ and __len__ functions. Initially, Python verifies the definition of _bool_ function; if […]

Android Programming – Create a background Service

Through our Previous Articles, we have discussed Creating an Android Service and Creating a Bounded Service. These services are user-interactive; which means, these are foreground services. We can interact with the Services through the User Interface elements. We have another type of Android Service, which is called Background Service. In this article, we are going […]

PowerShell – Functions

Functions are code blocks holds the sequence of statements and can be called using their names whenever / wherever required. The list of statements inside the function are grouped with in the curly braces (“{ }”). Defining and using the Functions in PowerShell are easy and will discuss how to do this in this Article. […]

Python – Truth Value Testing for Class objects

We have discussed Truth Value Testing in our previous Article, “Python – Truth Value Testing“; where we have discussed that Class objects are, by default considered True for Truth Value Testing. Through this article, we will discuss the Truth Value Testing for Class objects. Truth Value Testing for Class objects By default, Truth Value Testing […]

Scroll to top