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 […]
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 – 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: […]
Python – Program to find ASCII value of a character
In this post, we will write a Python program for how to find ASCII value. First, let’s see What is ASCII value? In programming languages, the characters (variable) holds ASCII value which is an integer number rather than that character itself is known as the ASCII value of character. ASCII stands for American Standard Code […]
Python – Program to Find Circumference of a Circle
In this post, we will write a program for how to calculate circumference of a circle in python. First, let’s see What is Circumference of Circle? The perimeter is the curve length around any closed figure. Formula: Circumference of Circle: C = 2 * pi * r Where, r = Radius of circle pi = […]
Python – Program to Find Area of a Circle
In this post, we will write a program for how to calculate the area of a circle in python. First, let’s see What is the Area of Circle? The area enclosed by a circle of radius r in 2-dimensional plane. Formula: Area of circle: A = pi * r * r Or pi * r […]
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: […]
Python – program to calculate Compound Interest
In this post, we will write a program for how to calculate compound interest in python. First, let’s see What is compound Interest? Compound Interest is also called compounding interest which is calculated on the principal (initial principal) that is the addition of interest to the principal sum of a loan or deposit. The formula […]
Python – program to calculate simple interest
In this post, we will write a program for how to calculate simple interest in Python. First, let’s see What is Simple Interest? Simple interest is an interest calculated on the principal amount of a loan or the original contribution to a savings account. Simple Interest: I = (P * R * T) / 100 […]