Categories
Python Examples

Python Program to Print Hello world!

A simple program that displays “Hello, World!”. It’s often used to illustrate the syntax of the language. Source Code # […]

Categories
Python Examples

Python Program to Print Output Without a Newline

In this example, you will learn to print output without a newline. Using end keyword # print each statement on […]

Categories
Python Examples

Python Program to Convert Celsius To Fahrenheit

In this program, you’ll learn to convert Celsuis to Fahrenheit and display it. In the program below, we take a […]

Categories
Python Examples

Python Program to Convert Kilometers to Miles

In this example, we’ll learn to convert kilometers to miles and display it. Example: Kilometers to Miles # Taking kilometers […]

Categories
Python Examples

Python Program to Generate a Random Number

In this example, you will learn to generate a random number in Python. To generate random number in Python, randint() […]

Categories
Python Examples

Python Program to Swap Two Variables

In this example, you will learn to swap two variables by using a temporary variable and, without using temporary variable. […]

Categories
Python Examples

Python Program to Solve Quadratic Equation

This program computes roots of a quadratic equation when coefficients a, b and c are known. The standard form of […]

Categories
Python Examples

Python Program to Calculate the Area of a Triangle

In this program, you’ll learn to calculate the area of a triangle and display it. If a, b and c […]

Categories
Python Examples

Python Program to Find the Square Root

In this program, you’ll learn to find the square root of a number using exponent operator and cmath module. Example: […]

Categories
Python Examples

Python Program to Add Two Numbers

In this program, you will learn to add two numbers and display it using print() function. In the program below, […]