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 […]
Tag: python
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 […]
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 […]
Python – Tuples
This article covers about tuples in python. Tuples can be a collection of homogeneous or heterogeneous items. It can be seen as similar to list but the major difference is that list is mutable unlike tuple which is immutable and list uses square brackets but in tuple we use parentheses. Creating a Tuple: a) Empty […]
Python – frozenset() function
In this article, we will be discussing frozenset() which is an inbuilt function provided by Python language. frozenset() function: The task of this function is to freeze the iterable objects provided and make them unchangeable So that, no changes take place. Also, frozenset() is somehow similar to set(). However, it differs only in making the […]
Python – Number Guessing Game
In this post, we will see how to make a number guessing game in python. So, let’s talk about the game, the user guesses a number in the fixed range then the program tells it is a correct guess or not. If not then the user can guess again. Now, we have to do the […]
Python – Strings
In this article, we’ll be covering about Strings in Python. Strings in Python are a sequence of characters enclosed in single-quotes, double-quotes or sometimes in triple-quotes. Output: <class ‘str’> Accessing characters in String: We can access characters in the string by using an index number in the square brackets. Output: H o Iterating through String: […]
Data Types in Python
As we know Python is an object-oriented programming language so everything is considered as an object in Python, data types are actually classes and variables are instance (object) of these classes. Depending upon the properties, there are manly 7 basic data types: 1. Numbers: This datatype mainly has a numerical value. Integer Float Complex Output: […]
Operators in Python
Operators are used to performing operations on values. Operators in Python are divided into the following categories : Arithmetic operators Assignment operators Logical operators Comparison operators Identity operators Membership operators Bitwise operators Arithmetic operators: These operators are used to perform mathematical operations (addition, subtraction, multiplication, division) on numerical values. “+”: This operator is used to […]
Python Lists
The List is a collection of heterogeneous data type that is ordered and changeable i.e. mutable. It allows duplicate members. Creation of list: Using square brackets: Output: [] [‘apple’, ‘orange’, ‘kiwi’] Using list() built-in function: Output: [] [‘a’, ‘p’, ‘p’, ‘l’, ‘e’] Access elements of the list: We can access any element from the list […]