Here we will see how to easily add two numbers in python3 using built-in functions. please run this program with python3. Steps: 1. Take input of the two binary numbers as string using the input function. 2. convert them into…
Category: python
Ipython, an alternative Interactive Python interpreter [tutorial]
Ipython is an interactive python shell which can be used as a replacement for your default python interpreter. Install Ipython pip install Ipython Launch Ipython Just enter ipython in your terminal aman@vostro:~$ ipythonPython 3.5.2 (default, Nov 23 2017, 16:37:01) Type…
3 Common ways to Reverse a String in Python
One of the very common problems in any programming language is how to reverse a String. Let’s see a few ways to do this in python. 1. Using String Slicing well first of all the most easy way.. Here we…
Python Program to Check if a number is FIbonacci
In Fibonacci Sequence, every previous two numbers gives the next number. the first 10 Fibonacci numbers: 0, 1, 1, 2, 3, 5, 8, 13, 21, 35 In this python Program we will see how to test if a number given…
Python Program to check if a number is Perfect Square
A number that can be expressed as the product of two equal integers is a Perfect Square number. for example: 25 can be expressed as 5 x 5 In the given python3 code we take a user input and take…
Merge Sort Program in Python
We will look at the Merge Sort Algorithm which is used to sort an unsorted list. The input list is divided into two parts and they are solved recursively and then they are merged. Worst Case Time Complexity: O(n log…
Python Program to Generate Fibonacci Series using Recursion
Fibonacci Series: A sequence of numbers in which each number is the sum of the previous two numbers. First 10 Fibonacci numbers: 0,1,1,2,3,5,8,13,21,34,… In the following python program we have used recursive function to find out the Fibonacci series up…
Understand Python Dictionary (key-value pair / Hash Map)
This tutorial is about Python dictionary which is data-structure representing key-value pairs, you can also call it a HashMap. One of the very common use of hashmap is finding frequency of characters in a string Basically a dictionary is like…
Python Program for Linear Search using For loop
In linear search algorithm we match the element to be searched with the entire list of elements. Therefore its a brute force approach. time complexity: O(n) Linear Search implementation in Python: list_of_elements = [4, 2, 8, 9, 3, 7]x =…
Python Program to find frequency of Characters in a String
We will find the count of repeating characters in a string using python3. Here we have used dictionary data structure to make a key-value pair for all alphabets and numbers, where the key is the alphabet or number and value…