Found 26504 Articles for Server Side Programming

Installing Python on Linux

Mohd Mohtashim
Updated on 24-Jan-2020 11:01:47

608 Views

Python distribution is available for a wide variety of platforms. You need to download only the binary code applicable for your platform and install Python.If the binary code for your platform is not available, you need a C compiler to compile the source code manually. Compiling the source code offers more flexibility in terms of choice of features that you require in your installation.Here are the simple steps to install Python on Unix/Linux machine.Open a Web browser and go to https://www.python.org/downloads/Follow the link to download zipped source code available for Unix/Linux.Download and extract files.Editing the Modules/Setup file if you want to customize ... Read More

Why You Should Learn Python Programming?

Mohd Mohtashim
Updated on 24-Jan-2020 10:58:56

296 Views

Python is a high-level, interpreted, interactive and object-oriented scripting language. Python is designed to be highly readable. It uses English keywords frequently where as other languages use punctuation, and it has fewer syntactical constructions than other languages.Python is a MUST for students and working professionals to become a great Software Engineer specially when they are working in Web Development Domain. I will list down some of the key advantages of learning Python −Python is Interpreted − Python is processed at runtime by the interpreter. You do not need to compile your program before executing it. This is similar to PERL ... Read More

10 Reasons why you should Learn Python

Sharon Christine
Updated on 23-Jan-2020 05:21:27

2K+ Views

Python is a totally free language to download, use, and code. Its commands are mostly in simple English. This makes it easy to remember and write commands. The code is readable and with a little knowledge, a developer can learn many things just by looking at the code.It has standard libraries that offer a lot of functionalities which lets you implement complex applications with ease. Python was designed with the newbies in mind. The use of white space and common expressions has eliminated the need for tedious variable declarations and ugly braces.Your First Steps in ProgrammingPython can be your starting ... Read More

Print a pattern without using any loop in C++

sudhir sharma
Updated on 22-Jan-2020 12:44:25

699 Views

In this problem, we are given a number n. Our task is to print patterns with decreasing to 0 or negative then increasing back to the number.Let’s take an example to understand the problem,Input: n = 12 Output: 12 7 2 -3 2 7 12To solve this problem, we will use recursion and call the function after each update. The track of update is kept using the flag variable which tells the function to increase or decrease the number by 5.ExampleThe below code gives the implementation of our solution, Live Demo#include using namespace std; void printNextValue(int m){    if (m > 0){       cout

Print a String in wave pattern in C++

sudhir sharma
Updated on 22-Jan-2020 12:42:59

530 Views

In this problem, we are given a string and an integer n. Our task is to print the given string in a wave pattern of n lines.Let’s take an example to understand the problem, Input: Tutorial n = 3 Output: T             r    U       o       i       s       t                lWave patterns are printed by printing each character of the string one by one in the next line and tab space away from the next element till ... Read More

Print all 3 digit repeating numbers in a very large number in C++

sudhir sharma
Updated on 22-Jan-2020 12:38:07

311 Views

In this problem, we are given a number. And we have to print all 3 digit repeating numbers.Let’s take an example to understand the problem, Input: 98769876598765 Output:    987: 3 times    876: 3 times    765: 2 timesTo solve this problem, we will use the large number which is stored string. The digits of the numbers are counted as characters. Now, we will check the first three numbers and then start from the 3rd index to the end and get a new number. After this, we will check for the next 3 digit numbers are count its frequency. ... Read More

Print all combinations of balanced parentheses in C++

sudhir sharma
Updated on 22-Jan-2020 12:36:07

756 Views

In this problem, we are given an integer n. Our task is to print all possible pairs of n balanced parentheses.Balanced parentheses are parentheses pairs that have a closing symbol for every corresponding opening symbol. Also, pairs should be properly nested.Let’s take an example to understand the problem, Input: n = 2 Output: {}{} {{}}To solve this problem, we need to keep track of pairs of brackets. The initial count of brackets is 0. Then we will recursively a function till the total bracket count is less than n. Count brackets, recursively call for brackets based on the count. If ... Read More

Print all combinations of factors in C++

sudhir sharma
Updated on 22-Jan-2020 12:33:42

287 Views

In this problem, we are given a number n. Our task is to print all combinations of factors of n.Let’s take an example to understand the topic better −Input: 24 Output: 2 2 2 3 2 4 3 8 3 4 6 2 12For this, we will use recursion function which will find a combination of factors of the number. And we will store all our combinations in an array of array.ExampleThis code will show the implementation of our solution. Live Demo#include using namespace std; vector factor_Combo; void genreateFactorCombinations(int first, int eachFactor, int n, vectorfactor) {    if (first>n || eachFactor>n) ... Read More

Print all combinations of points that can compose a given number in C++

sudhir sharma
Updated on 22-Jan-2020 12:31:18

225 Views

In this problem, we are given the total score n. Print all combinations of basketball points that are 1, 2, and 3 that give a total score of n.Let’s see an example to understand the problem, Input: 4 Output: 1 1 1 1 1 1 2 1 2 1 1 3 2 1 1 2 2 3 1To solve this problem, we will use recursion. And fix and resources for rest values n-s, where s is the score. If the combination adds up to n, print the combination.ExampleThe code shows the implementation of our code − Live Demo#define MAX_POINT 3 #define ... Read More

Print all distinct characters of a string in order in C++

sudhir sharma
Updated on 22-Jan-2020 12:28:43

1K+ Views

In this problem, we are given a string. Our task is to print all distinct characters of the string in the order they appear in the string.Let’s take an example to understand our problem, Input: tutorials Point Output: uralsPnThere are multiple ways to solve this problem but we will discuss the most effective one. The simple one includes the nesting of loops.For this, we will use two arrays of size 256(8-bit characters are stored).First we will initialize all values of counter array to 0 and all values of index array to n (length of string). On traversal of the string ... Read More

Advertisements