Posts

What is tree ?

Image
What is tree. Trees: Trees are multilevel data structures with a hierarchical relationship among its elements known as nodes. The bottommost nodes in the hierarchy are called leaf node while the topmost node is called root node. Each node contains pointers to point adjacent nodes.     Type of Tree. General Tree. Forests. Binary Tree. Binary Search Tree. Expression Tree. Tournament Tree. Tree data structure is based on the parent-child relationship among the nodes . Each node in the tree can have more than one children except the leaf nodes whereas each node can have at most one parent except the root node. Trees can be classified into many categories which will be discussed later in this tutorial. Thank you very much for reading carefully, if you have any other questions, you can share it with us through comments, if this information was important to you, please let us know through comments. Please do comment and share. Than...

What is Data Structure ?

Image
What is Data Structure ? Data Structure is a way to store and organize data so that it can be used efficiently. Data structures are the building blocks of any program or the software. Choosing the appropriate data structure for a program is the most difficult task for a programmer. Following terminology is used as far as data structures are concerned. Data: Data can be defined as an elementary value or the collection of values, for example, student's name and its id are the data about the student. Group Items: Data items which have subordinate data items are called Group item, for example, name of a student can have first name and the last name. Record: Record can be defined as the collection of various data items, for example, if we talk about the student entity, then its name, address, course and marks can be grouped together to form the record for the student. File: A File is a collection of various records of one type of entity, for example,...

Python Operators

Image
What are operators in python ? Operators are special symbols in Python that carry out arithmetic or logical omputation. The value that the operator operates on is called the operand. Type of operators in python Arithmetic operators. Comparison operators. Logical operators. Bitwise operators. Assignment operators. Special operators.

Python Program to Calculate the Area of a Triangle

Image
Question : Python Program to Calculate the Area of a Triangle. # Python Program to find the area of triangle a = 5 b = 6 c = 7 # calculate the semi-perimeter s = (a + b + c) / 2 # calculate the area area = (s*(s-a)*(s-b)*(s-c)) ** 0.5 print ( 'The area of the triangle is %0.2f ' %area) OUTPUT The area of the triangle is 14.70 Question : Python Program to Calculate the Area of a Triangle take inputs from the user. # Python Program to find the area of triangle # take inputs from the user # a = float (input( 'Enter first side: ' )) # b = float (input( 'Enter second side: ' )) # c = float (input( 'Enter third side: ' )) # calculate the semi-perimeter s = (a + b + c) / 2 # calculate the area area = (s*(s-a)*(s-b)*(s-c)) ** 0.5 print ( 'The area of the triangle is %0.2f ' %area) OUTPUT Enter first side: 5 Enter second side: 6 Enter third side: 7 The area of the tri...

Python Version List

Image
Python Version List Python programming language is being updated regularly with new features and supports. There are lots of updates in python versions, started from 1994 to current release. Python versions with its released date is given below. Python Version Released Date Python 1.0 January 1994 Python 1.5 December 31, 1997 Python 1.6 September 5, 2000 Python 2.0 October 16, 2000 Python 2.1 April 17, 2001 Python 2.2 December 21, 2001 Python 2.3 July 29, 2003 Python 2.4 November 30, 2004 Python 2.5 September 19, 2006 Python 2.6 October 1, 2008 Python 2.7 July 3, 2010 Python 3.0 December 3, 2008 Python 3.1 June 27, 2009 Python 3.2 February 20, 2011 Python 3.3 September 29, 2012 Python 3.4 March 16, 2014 Python 3.5 September 13, 2015 Python 3.6 December 23, 2016 Python 3.7 June 27, 2018 Thank you very much for reading carefully, if you have any other questions...

Function

Image
Functions. A function is a block of code which only runs when it is called. In Python programming, Functions is a group of related statements that performs a specific task. You can pass data, known as parameters, into a function. A function can return data as a result. Functions make our program more organized and help in code re-usability. Features of Functions Functions help in code reusability. Functions provide organization to the code. Functions provide abstraction. Functions help in extensibility. Creating a Function In Python a function is defined using the def keyword: Example : def my_function():   print("Hello from a function") Calling a Function To call a function, use the function name followed by parenthesis: Example : def my_function():   print("Hello from a function") my_function() Thank you very much for reading carefully, if you have any other questions, you can share it with us th...