-
Ranjani R started the topic Enumerations in python in the forum C++ 2 years, 5 months ago
Enumerate() in Python
Often, when dealing with iterators, we also get need to keep a count of iterations. Python eases the programmers’ task by providing a built-in function enumerate() for this task. Enumerate() method adds a counter to an iterable and returns it in a form of enumerating object. This enumerated object can then be used directly f…[Read more] -
Ranjani R started the topic Multiple inheritance in python in the forum C++ 2 years, 5 months ago
Multiple Inheritance in Python
Inheritance is the mechanism to achieve the re-usability of code as one class(child class) can derive the properties of another class(parent class). It also provides transitivity ie. if class C inherits from P then all the sub-classes of C would also inherit from P.Multiple Inheritance
When a class is derived…[Read more] -
Ranjani R started the topic Abstract classes in python in the forum C++ 2 years, 5 months ago
Abstract Classes in Python
An abstract class can be considered as a blueprint for other classes. It allows you to create a set of methods that must be created within any child classes built from the abstract class. A class which contains one or more abstract methods is called an abstract class. An abstract method is a method that has a declaration…[Read more] -
Ranjani R started the topic Inheritance in Python in the forum C++ 2 years, 5 months ago
Inheritance in Python
One of the core concepts in object-oriented programming (OOP) languages is inheritance. It is a mechanism that allows you to create a hierarchy of classes that share a set of properties and methods by deriving a class from another class. Inheritance is the capability of one class to derive or inherit the properties from…[Read more] -
Ranjani R started the topic Class variables in python in the forum C++ 2 years, 5 months ago
Python Class Variables
Updated on: February 7, 2022 | 7 CommentsIn Object-oriented programming, when we design a class, we use instance variables and class variables.
In Class, attributes can be defined into two parts:
Instance variables: If the value of a variable varies from object to object, then such variables are called instance…[Read more]
-
Ranjani R started the topic Classes and objects in python in the forum C++ 2 years, 5 months ago
Python Classes and Objects
A class is a user-defined blueprint or prototype from which objects are created. Classes provide a means of bundling data and functionality together. Creating a new class creates a new type of object, allowing new instances of that type to be made. Each class instance can have attributes attached to it for maintaining…[Read more] -
Ranjani R started the topic If-elif-else ladder in python in the forum C++ 2 years, 5 months ago
if-elif-else ladder
Here, a user can decide among multiple options. The if statements are executed from the top down. As soon as one of the conditions controlling the if is true, the statement associated with that if is executed, and the rest of the ladder is bypassed. If none of the conditions is true, then the final else statement will be…[Read more] -
Ranjani R started the topic Nested-if statement in python in the forum C++ 2 years, 5 months ago
nested-if statement
A nested if is an if statement that is the target of another if statement. Nested if statements mean an if statement inside another if statement. Yes, Python allows us to nest if statements within if statements. i.e, we can place an if statement inside another if statement.Syntax:
if (condition1):
# Executes when…[Read more] -
Ranjani R started the topic If-else statement in python in the forum C++ 2 years, 5 months ago
if-else statement
The if statement alone tells us that if a condition is true it will execute a block of statements and if the condition is false it won’t. But if we want to do something else if the condition is false, we can use the else statement with if statement to execute a block of code when the if condition is false.Syntax:
if (…[Read more]
-
Ranjani R started the topic If statement in python in the forum C++ 2 years, 5 months ago
if statement
The if statement is the most simple decision-making statement. It is used to decide whether a certain statement or block of statements will be executed or not.Syntax:
if condition:
# Statements to execute if
# condition is true
Here, the condition after evaluation will be either true or false. if the statement accepts…[Read more] -
Ranjani R started the topic Type conversion in python in the forum C++ 2 years, 5 months ago
Type Conversion in Python
Python defines type conversion functions to directly convert one data type to another which is useful in day-to-day and competitive programming. This article is aimed at providing information about certain conversion functions.There are two types of Type Conversion in Python:
Implicit Type Conversion
Explicit Type…[Read more] -
Ranjani R started the topic Python datetime module? in the forum C++ 2 years, 5 months ago
Python datetime module
In Python, date and time are not a data type of their own, but a module named datetime can be imported to work with the date as well as time. Python Datetime module comes built into Python, so there is no need to install it externally.Python Datetime module supplies classes to work with date and time. These classes…[Read more]
-
Ranjani R started the topic Keywords in python in the forum C++ 2 years, 5 months ago
Python Keywords
Python keywords are special reserved words that have specific meanings and purposes and can’t be used for anything but those specific purposes. These keywords are always available—you’ll never have to import them into your code.Python keywords are different from Python’s built-in functions and types. The built-in functio…[Read more]
-
Ranjani R started the topic Exception handling in Java in the forum C++ 2 years, 5 months ago
Exceptions in Java
Exception Handling in Java is one of the effective means to handle the runtime errors so that the regular flow of the application can be preserved. Java Exception Handling is a mechanism to handle runtime errors such as ClassNotFoundException, IOException, SQLException, RemoteException, etc.Exception is an unwanted or…[Read more]
-
Ranjani R started the topic What is string in Java? in the forum C++ 2 years, 5 months ago
Strings in Java
In the given example only one object will be created. Firstly JVM will not find any string object with the value “Welcome” in the string constant pool, so it will create a new object. After that it will find the string with the value “Welcome” in the pool, it will not create a new object but will return the reference to the same -
Ranjani R started the topic What are the operators in Java? in the forum C++ 2 years, 5 months ago
Operators in Java are the symbols used for performing specific operations in Java. Operators make tasks like addition, multiplication, etc which look easy although the implementation of these tasks is quite complex.
Types of Operators in Java
There are multiple types of operators in Java all are mentioned below:Arithmetic Operators
Unary…[Read more] -
Ranjani R started the topic What is meant by objects in Java? in the forum C++ 2 years, 5 months ago
Objects in Java
It is a basic unit of Object-Oriented Programming and represents real-life entities. A typical Java program creates many objects, which as you know, interact by invoking methods. An object consists of :State: It is represented by attributes of an object. It also reflects the properties of an object.
Behavior: It is represented…[Read more] -
Ranjani R wrote a new item 2 years, 5 months ago
Classes in Java A Java class is a set of object which shares common characteristics/ behavior and common properties/ attributes. There are certain points about Java Classes as mentioned below: Class is not a […]
-
Ranjani R started the topic Enumeration in c++ in the forum C++ 2 years, 5 months ago
Enumeration (Enumerated type) is a user-defined data type that can be assigned some limited values. These values are defined by the programmer at the time of declaring the enumerated type.
If we assign a float value to a character value, then the compiler generates an error. In the same way, if we try to assign any other value to the enumerated…[Read more]
-
Ranjani R started the topic Recursion in c++ ? in the forum C++ 2 years, 5 months ago
Recursion is a method in C++ which calls itself directly or indirectly until a suitable condition is met. In this method, we repeatedly call the function within the same function, and it has a base case and a recursive condition. The recursive condition helps in the repetition of code again and again, and the base case helps in the termination of…[Read more]
- Load More
