In this article, We will be going to see How to find the roots of a quadratic equation: A*x^2 + B*x + C. Example: Input: Quadratic Equation: 1X^2 + 5X + 2 Output: The Roots of a Quadratic Equations are: -0.4384 and -4.5616 for finding the roots we are using given below rules: D = […]
Category: Python
Python is an interpreted, high-level, general-purpose programming language. Created by Guido van Rossum and first released in 1991…
In this category, we will cover topics like data types, operators, keywords, functions, loops, conditional statements, etc….
Python program to convert Centimeter into Inches
In this article, We will see How to Convert the Centimeter unit into Inches. Example: Input: Centimeter: 8 Output: Inches: 3.152 As we know that, 1 centimeter = 0.394 inches (approx) so we are using this information for writing this program. Now, let’s see the different ways to code this program: Code 1: Output: Centimeter […]
Python program to add two numbers
In this Article, We will see How to add two numbers in Python. Example: Input: number1 = 12, number2 = 13 Output: 25 Input: number1 = 10, number2 = 40 Output: 50 Now, let’s see the different ways to code: Code 1: Output: 25 Code 2: Output: 25 Code 3: Output: Enter 1st Number: 10 […]
Python program to calculate Median of a integer list
In this post, we will see the Python program for calculating the median of a given integer list. Examples: Given list: [10, 20, 30, 40, 0, 12, 100] Median of the given data is : 20 Given list: [10, 20, 30, 40, 0, 12, 100, 200] Median of the given data is : 25.0 Now, […]
Set up Python virtual environment using Anaconda
While working with python, we usually face the problem of setting up the virtual environment. In this blog I have covered the steps of creating virtual environment in python. Anaconda : Anaconda is an open source software that contains Jupyter, spyder idle etc that are used for large data processing, data analytics, heavy scientific computing. […]
How to count amino acid in a protein sequence using Python program
In this article, we are going to learn how python can be useful in finding amino acid in a given protein sequence. Before reading this article you must know about FASTA format and single letter code for the amino acid. (Click here FASTA format) Here, we will learn how can we find the total length […]
Python – Different ways to Reverse a String
In this post, We will see different ways to Reverse a string in Python. Code 1: Using the concept of string-Slicing. Output: Reverse String: nohtimehcoiB Code 2: Using the concept of Looping and string-Concatenation. Output: Reverse String: nohtimehcoiB Code 3: Using the concept of Reverse Looping. Output: Reverse String: nohtimehcoiB Code 4: Using reversed(),list() and […]
Python – Set
Set in Python is an unordered and non-indexed collection of elements that are non-duplicate. It is a Mutable data-type. Creating a Set: a) Using a { }: Set can be created using curly brackets, serparated by comma. Output: {‘d’, ‘b’, ‘c’, ‘e’, ‘a’} b) Using a set() function: Set can be created using set() built-in […]
Python – Dictionary
In Python, Dictionary is an unordered, indexed collection of data values used to store data in the form of keys and values. Keys must be unique whereas values can be repeated. Only immutable data types like string, tuple, int, etc. can be used as keys. Creating a Dictionary: a) Using a { }: Dictionary can […]
How to find out the complementary strand of DNA using Python
What is a complementary strand? DNA (deoxyribonucleic acid) is made up of pentose Sugar, nitrogenous bases, and phosphate. DNA has a backbone of sugar and phosphate. As we all know DNA is a double helical structure (Watson & crick model) and both the strand of DNA are complementary of each other. So, what does it […]