Now imagine an Array where the numbers are stored in an orderly manner. Means minimum index stores the lowest number and the maximum index number (Here the number is 6) stores the highest number but in the orderly manner. Please take a look for a sample ordered Array as shown below:- Here in the above…
Month: April 2020
Python Game: Lottery Winner
Here we will randomly select the name from list of names, and randomly prizes will be assigned to them. So lets write the outline of the code. Now let’s check the code:- This code will work, now we have to check whether the code design is correct or not, which can be checked using Pylint….
Mongo Db: Normalization and De-Normalization
Normalization:- There are present multiple ways to represents your data. One of the way is in a Normalized way. Normalized way means, dividing up the data in to multiple collections. Another important aspect is that document of one collection can be referenced by the multiple documents of the different collections. That means there present some…
Java composition with example
In one word, composition is nothing but a ‘Has-A’ relationship. As we know, in object oriented programming there are two popular relationship present, one is ‘Is A’ and another one is ‘Has A’ relationship. The main benefit of has a relationship is that this can reference many classes. Let us check an example of Television….
Concept of Compound Index in MongoDB for interview
Compound index means when we are creating an index on more than one keys. The best way to check how compound index affect the searching and sorting time is directly test it in the Mongo shell. Let’s create one collection of student with keys ‘student_id’,’student_name’ and ‘age’:- Now we will try to sort this output…
JavaScript Scope
In JavaScript we can define variable by using “var” and “let” keyword. JavaScript scope works slightly different way than other object oriented programming language like java. In the below example please look how the variables are defined:- Here “var” keyword works differently than the “let” keyword. Here “let” will not be executed at the very…
Array using Java: Array which is storing unsorted and non duplicate data
Array is a simple data-structure where we store same type of data. Array can not store multiple types of data. There are different types of Array. And the way in which data is stored within the Array can have infinite combinations. Few examples:- Suppose we will store in it non duplicate values , or we…
Class 2: Python and Object Oriented Programming
My cat and My neighbor’s cat both has different name. Now we can create this name attribute at the time when we are creating the object. The main benefit is, the code will be much more shorter, clean and more readable. This can be achieved with the help of constructor. In the above example, I…
Class 1:- Python and Object Oriented Programing
I have a White cat and also my neighbor has a Black cat. So in the OOP paradigm the cat is blueprint and from using that blueprint we can create several cat objects with different attributes specific to that object. Like here, they both have four legs but they have different color and size. So,…
Focus, the toughest things for many of us!!!
Whether you are a student, an employee or you are a living being, the focus is very much important to achieve success. Without laser like focus no body can achieve their goal in a defined time line. And lacking of focus leads to frustration, broken-heart, depression and in an extreme case, the death. And the…