Another common task with strings is to concatenate them , join them together Example 1 In the following example we ask the user for 2 strings and then concatenate them. …
Exercises
-
Insertion sort is a simple sorting algorithm that builds the final sorted array (or list) one item at a time. It is much less efficient on large lists than more …
-
A merge sort is an efficient, general-purpose, and comparison-based sorting algorithm. Most implementations produce a stable sort, which means that the order of equal elements is the same in the …
-
In this article we show how to count a vowel or consonant in python We will also show you a commonly found piece of code that does this incorrectly, I’ve …
-
In this code example we show how to read a file word by word and display the contents The process is as follows Open a file in read mode which …
-
In this article we show you how to convert a decimal number into binary, octal, and hexadecimal numbers. Here are a brief description of the common systems Decimal System: This …
-
In this article we will show you how to create a program in python to check if a year is a leap year. First of all lets see a definition …
Pigeonhole sorting is a sorting algorithm that is suitable for sorting lists of elements where the number of elements and the length of the range of possible key values are approximately the …
In this article we look at whether a number is odd or even. There is a fairly simple formula to work this out – If you divide a number by …