
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 26504 Articles for Server Side Programming

779 Views
In this tutorial, we are going to write an anonymous function using lambda to rearrange positive and negative number in a list. We need the pick the negative numbers and then positive numbers from a list to create a new one.AlgorithmLet's see how to solve the problem step by step.1. Initialize a list with negative and positive numbers. 2. Write a lambda expression the takes a list as an argument. 2.1. Iterate over the list and get negative numbers 2.2. Same for positive numbers 2.3. Combine both using concatination operator. 3. Return the resultant list.Note - Use ... Read More

484 Views
In this tutorial, we are going to learn about the logarithmic functions from math module. We have four variants of logarithmic functions. Pythons' provides all of them in the math module. Let's learn about them one by one.math.log(number, [Base])The math.log(number, [Base]) method is used to compute the logarithm of any Base. If we didn't specify any base value, then it will take e as default base.Note − You will get ValueError if you pass a negative number to the method.ExampleLet's see some examples. Live Demo# importing math module import math # logarithm with base 3 print(math.log(15, 7))OutputIf you run the above ... Read More

4K+ Views
In this tutorial, we are going to learn about the private variables in Python classes.Python doesn't have the concept called private variables. But, most of the Python developers follow a naming convention to tell that a variable is not public and it's private.We have to start a variable name with a double underscore to represent it as a private variable (not really). Example:- one, two, etc.., .As we already said the variables whose names start with a double underscore are not private. We can still access. Let's see how to create private type variables and then we will see how ... Read More

408 Views
In this tutorial, we are going to learn how to use dictionary comprehensions in Python. If you are already familiar with list comprehension, then it won't take much time to learn dictionary comprehensions.We need the key: value pairs to create a dictionary. How to get these key-value pairs using dictionary comprehension? See the general statement of dictionary comprehension.{key: value for ___ in iterable}We need to fill in the above statement to complete a dictionary comprehension. There are many ways to fill it. Let's see some of the most common ways.Let's see how to generate numbers as keys and their squares ... Read More

1K+ Views
In this tutorial, we are going to write a program that prints the name of the Python script file. We can find the script name using the sys module.The sys module will store all the command line arguments of python command in the sys.argv list. The first element in the list is the script name. We can extract it from that list. Python makes it easy.Let's see the steps involved in the program.Import the sys module.Now, print the first element of the sys.argv list.That's it. You got the script name.ExampleLet's see it practically. Live Demo# importing the sys module import sys ... Read More

391 Views
Python is a high-level, general-purpose programming language. It is used in website development, machine learning, and creative software technology. Guido Van Rossam created Python in the Netherlands in 1989. Python became public in 1991. New programmers are typically advised to learn Python. Ruby is an interpreted, open-source, object-oriented language. It was developed by Yukihiro Matsumoto in the year 1995. Ruby is an object-oriented language, hence everything is an object. OOP gives developer projects a modular structure. Read through this article to find out more about Python and Ruby and how they are different from each other. What is ... Read More

364 Views
In this tutorial, we are going to learn about the try and except of Python. Python has a concept called error and exception handling.The keywords try and except are used in the error and exception handling.Basically, we will find two types of errors in Python. They are −Syntax errors - Python gives these types of error when it doesn't understand a line of code in the program.Exception errors - Errors which are detected during the runtime of the program. Ex:- ZeroDivisionError, ValueError, etc.., We can't stop syntax errors. But, we can intimate if the program runs into an exception error ... Read More

907 Views
In this tutorial, we are going to learn about Unit Testing using the unittest built-in module. Testing plays a major role in software development. You will know the issues before going to the production itself.We'll learn the basics of testing in Python using the built-in module called unittest. Let's jump into the tutorial.What is Unit Testing?If you take the login system as an example. Each field in the login form is a unit/component. And testing those units/components functionality is known as Unit Testing.ExampleLet's see the basic structure of unittest framework. Live Demo# importing unittest module import unittest # unittest will test ... Read More

159 Views
List are the type of containers that stores data in sequential manner and allocate noncontiguous memory to the elements. In C++, lists are considered as doubly linked list where insertion and deletion of elements can be done from both the ends and therefore, it is also possible to traverse the list from both the end. For using singly linked list we use the forward list available in C++ STL.Advantage of using List over vector is thatList are faster in insertion and deletion of elements available in list container if the iterator is positioned to the correct element.Disadvantage of using List ... Read More

447 Views
In C++ STL, stack is used as container which is implemented as LIFO structure. LIFO means Last In First Out. Stack can view as a pile of books in which the books are arranged one above the another and the last inserted book will be the first one to be removed that’s why it is called as a LIFO structure.The operations associated with the stack are -Top() - This function returns the reference to the topmost element of a stack.Syntax - name_of_stack.top()Parameters - No ParameterReturn Value - Reference to the topmost element of a stack containerPush() - This function is ... Read More