Here we will write a program in Python to Reverse a number using while loop. Lets start with the steps: Step-wise Solution: 1. Take the value of the integer and store in a variable. 2. Using a while loop, get each digit of the number and store the reversed number in another variable. 3. Print […]

## Python Program to Make a Simple Calculator

Here we will write a program in Python to make a Simple Calculator which will implement addition, subtraction, multiplication and division depending upon the input from user. Lets see how: In this program, we ask the user to choose the desired operation. Options 1, 2, 3 and 4 are valid. Two numbers are taken and […]

## Python Program to Find the Largest Among Three Numbers

Here we will write a program in Python to find the largest among three numbers using if-else. In the program below, the three numbers are stored in num1, num2 and num3 respectively. I’ve used the if…elif…else ladder to find the largest among the three numbers. Python Program to Find the Largest Among Three Numbers:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# Python program to find the largest number among the three input numbers # change the values of num1, num2 and num3 # for a different result num1 = 10 num2 = 14 num3 = 12 # uncomment following lines to take three numbers from user #num1 = float(input("Enter first number: ")) #num2 = float(input("Enter second number: ")) #num3 = float(input("Enter third number: ")) if (num1 >= num2) and (num1 >= num3): largest = num1 elif (num2 >= num1) and (num2 >= num3): largest = num2 else: largest = num3 print("The largest number between",num1,",",num2,"and",num3,"is",largest) |

OUTPUT:

1 2 3 4 5 |
The largest number between 10, 14 and 12 is 14.0 |

Comment for any suggestion, concerns.

## Python Program to Solve Quadratic Equation

Here we will write a program in Python to solve quadratic equation, so first lets understand how to solve a quadratic equation. The standard form of a quadratic equation is:

1 2 3 4 5 6 7 |
ax<sup>2</sup> + bx + c = 0, where a, b and c are real numbers and a ≠ 0 |

The value of a, b and c coefficients should be known to solve the quadratic equation, now lets write the program for the same. […]

## Python Program to Calculate Area of Triangle

Here we will write a program in Python to calculate Area of Triangle. To find the area of triangle we need the sides of the triangle, if this program will only work if we have sides of triangle. So let’s see how to calculate area of triangle: If a, b and c are three sides of a triangle. Then using […]

## Python Program to Convert Celsius To Fahrenheit

Here we will a program to convert Celsius to Fahrenheit in Python, lets first understand how to convert Celsius to Fahrenheit. How to convert? We will use the simple formula for the conversion of temperature from Celsius to Fahrenheit.

1 2 3 4 5 |
celsius * 1.8 = fahrenheit - 32 |

Now lets write the code for the same. Python Program to Convert Celsius To Fahrenheit […]