Category: Python programming question
-
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…
-
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…
-
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…
-
Java program to get sum of all digits of a number in Java
Approach Method 1 – Iterative Method 2 – Single line Method 3 – Recursive Output