This Python program shows how you can calculate the area of a triangle in python and display it using the python’s print method. How to Calculate the area if a triangle in Python? Assume that you have three variables side1,side2 and side3 which refers to the three sides of a triangle. The area of the […]
Python Program to Find the Square Root of Number
This python program will demonstrate how you can find the square root of a number using exponent operator python. Basic Program to find Square Root for Positive Number in Python Output The square root of 4.000 is 2.000 In this python program , we use the exponent operator ** to find the square root of […]
Python Program to Add Two Numbers
This Python program demonstrates how you can add two numbers in python and display it using the print() function. Python Program to Add Two Numbers Python program to add two numbers Output The sum of 898.2 and 111.6 is 1009.8000000000001 In this program , the variables number1 and number2 contains the numeric values that needs […]
Python Program to Display Hello world
This is a simple program written in Python language that displays Hello World. The programs demonstrates how the Python code looks like and is a beginner program. Python Program to Display Hello world Output This program uses the python’s built-in print function to display the string Hello, world in the screen. The strings in python […]
Python – How do list all files of a directory?
In Python ,you can list all files of a directory using the os.listdir(). How do list all files of a directory in Python? You can use the os.listdir() in pythpn which will list all the files that is in the directory includes files and directories. Incase you want just the files , you can filter […]
Python Program to add two integers
Problem Write a program in Python to add two integers and display the result on the screen. Python Program to add two integers Output Enter first number: 1 Enter second number: 2 1 + 2 = 3.0
Python Program to display "Hello, World!"
Problem Write a program in Python to display “Hello, World!” on the screen. Python Program to display “Hello, World!” in Console Window. This is a simple Python program that displays “Hello, World!” on the console window. Output Hello, World! The above Python program uses the print() function to display the Hello,World! string to the screen. […]