Author: Editorial Team
-
Python Program for factorial of a number
In mathematics, the factorial of a positive integer n, denoted by n!, is the product of all positive integers less than or equal to n: For example, Note: factorial is defined only for non-negative integer numbers. Finding factorial of a number in Python using Iteration 1. Factorial of a number using for loop Output 2.…
-
Python Program to print ASCII Value of a character
ASCII abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. Just to understand in simple language, it is a value given to different characters and symbols. For example, the ASCII value of alphabet A is 65. The task here is to print the ASCII value of the provided…
-
Base conversion functions in Python
Python provides base conversion functions to convert an integer number to another base. Whenever you print a binary, octal or a hexadecimal integer number, it is printed by default in decimal form. But sometimes there is a need to change base of an integer, for example, decimal form to binary form. Please note that all…
-
Python program to check whether a number is Prime or not
A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. An another way to define prime number is: a prime number is a natural number that has no positive divisors other than 1 and itself. Following are some prime numbers: 2,3,5,11,17…… We’ll…
-
float values in Python
float (floating point real values) or simply called floats, represent real numbers and are written with a decimal. The left of the decimal represents integer value and the right represents the fractional part. Floats may also be represented in scientific notation or exponential notation, with e or E indicating the power of 10, for example,…
-
Python program to find area of circle
In this article, we are going to discuss how to calculate the area of circle in Python with a given radius. The formula for calculating the area of circle is: Area of circle = π * r * r Here value of π (Pi) is 3.1415 (to 4 decimal places) and r is radius of…
-
Python program to add two numbers
We’ll write Python program to add two numbers. We’ll do it in two ways. First, we’ll find the sum of two numbers without user input i.e. assuming we already have the numbers. Second, we’ll find the sum of two numbers based on the user input i.e. user will provide two numbers to be added. Python…
-
Integral values in Python – an introduction
Integer is a number with no fractional part(no decimals). For example, 1, 100, 0, -999 are integers while 1.99 and 1/3 are not integers. We can represent integral values in four ways: Decimal (also base 10) This is the standard system for denoting integer. For example, 1,2,75,999. Binary (also base 2) A binary number uses…
-
Python Data Types
Before starting the discussion, please note that everything in Python is an object. Following are the types built into Python: None – This type has a single value and there is a single object with this value. This object is accessed through the built-in name None. It is used to signify the absence of a…
-
Is Python dynamically typed language??
Yes, Python is a dynamically typed language. Now to understand why Python is dynamically typed language, we should discuss a bit about what statically type and dynamically typed means. In a statically typed language, type of the variable is declared at the declaration of a variable itself. For example, in Java we can declare a…
