How to check if python is already installed?

Mac Operating System and Linux operating system has already python installed. Where as certain application needs python, so such application might have installed python in windows as well. So irrespective of the platform it is best to first check if python is already installed. How to check if Python is installed in windows 10? Open […]

Python Functions

So far we have seen using python created function for various purpose such as to know the length of list, sort list elements, print information etc. Can we create our own function? Yes. We can create our function in Python. Syntax def function_name(): //required code to accomplish a task User defined function should always begin […]

Python Set

Alike list and tuple, there is another kind of data type exist in python and that is Set. Set is unordered and unindexed. It means alike list and tuple, we can not access the elements of set using index number. Example: fruitnames={“Orange”,”Banana”,”Grape”} How to access elements of Set? By using for loop, we can print […]

Python Dictionary

There are situations where we may want to store key and value pair data in a variable. Dictionary Dictionary in python: Variable which holds data in key and value pair form is known as dictionary. Example: registration_numbers={“Rahul”:”99ik89lm”, “Ajay”:”99ik90lm”, “Vijay”:”99ik91lm”, “Sachin”:”99ik92lm”, “Krishna”:”99ik933lm”} How to print data from a dictionary variable in python? To print a value […]

Python Tuple

Python tuples are useful for listing elements (Objects). Tuple is quite similar to list but it has a difference. Tuple is slightly different than list. (I have discussed about list in one of the previous chapter) What is tuple? Tuple is collection of elements or objects. Objects of tuples are ordered in certain sequence. Which […]

Python List

List in Python programming is a type of variable which holds one or more than one elements. List Declaration We can use any name that has no space or any special character to declare a variable of type list. Example fruitnames=[“Orange”,”Banana”,”Grape”,”Pine Apple”,”Jackfruit”] roll_numbers=[101,102,103,104,105] While declaring list, square brackets are important. The starting square bracket, and […]

Python Loops

If a task is repetitive then its a loop. For example, if I want to print 100 for 100 times, then there are 100 loops. If I want to print all the names of class tenth 250 students, then here 250 loops are there. Now imagine, I need to print 10000 times the addition value […]

Python Different types of Operators

Operators in python programming are essential to perform various operations with more than one operands. For example, to perform addition operation between two the values of two variables we use addition operator. Similarly for subtraction we have subtraction operator. Lets know all these operator one by one. Addition Operator + Addition operator performs addition operation. […]

HTML Bold Tag, Italic Tag and Underline Tag

HTML has other essential tags such bold tag, Italic tag and Underline tag. Bold Tag Bold tag is used to set text as bold. Syntax <b>Some Text</b> Output Some Text Italic Tag Italic tag is used to set text as italic Syntax <i>Some Text</i> Output Some Text Underline Tag Underline tag is used to set […]

HTML Heading Tags H1, H2, H3, H4, H5, H6

Reader finds a content is easy to understand when the content is arranged in a proper structure. That is, content should begin with a heading text, and the rest content is divided into multiple sub heading texts. In a web page, we share a content with the reader. If the content is not well structured, […]

HTML Web Page Structure

HTML webpage has a structure which we are bound to follow. HTML Webpage Structure Every webpage must have two sections. head section body section How do we define head section? To define head section we use head tag. Head tag has opening and closing tag. (<head></head>) How do we define body section? To define body […]

Introduction to HTML for absolute Beginners

HTML is essential in designing webpages. No webpage is possible with out HTML. HTML is used to create webpage. What is HTML? HTML – Hypertext markup language is a language used to create and stylize HTML web pages. Who understands HTML? Any browser engine such as Chrome, Safari, Opera, Firefox, Internet Explorer understands HTML codes. […]

How to delay in Javascript?

In Javascript, we may face situation where we may want to make the javascript file to wait certain seconds. In simple language, how can we delay a function for certain amount of time. For this kind of requirement we use setTimeut function. SetTimeout Function setTimeout function is used to delay a process for certain amount of […]

How to get current full year using Javascript?

In some cases we may need to complete a task in loop. To handle such situation, we have for loop in Javascript. For Loop Lets begin with an example to understand the need of “for loop” Example Lets print 1 to 10 Solution: <script> var num=1; console.log(num); num++ // incremented the value by 1 console.log(num); num++ // […]

Javascript For Loop

In some cases we may need to complete a task in loop. To handle such situation, we have for loop in Javascript. For Loop Lets begin with an example to understand the need of “for loop” Example Lets print 1 to 10 Solution: <script> var num=1; console.log(num); num++ // incremented the value by 1 console.log(num); num++ // […]

Javascript If Else Statement

Before proceeding further lets first understand why if else if statement requirement came? Lets consider the simple situation, login process. A user is only allowed to access web pages of a website, if the user has logged in with valid credentials. See in the above case, “if” logic is there. Logic for login is as […]

Javascript Assignment Operators

To better understand what is an assignment operator, lets re-think once again how do we declare a variable and set value to it? Read Article: Variable Declaration in Javascript Assignment Operator The symbol of assignment operator is = Example <script> var num=100; </script> In the above example, we have declared variable name num. It holds the […]

Javascript Arithmetic Operators

To perform arithmetic operations Javascript has operators that performs the task. Operators Addition Operator As the name says, arithmetic operator performs arithmetic operation. The symbol of addition operator is + Example <script> var num1=10; var num2=20; alert(num1+num2); </script> Output:30 Subtraction Operator Subtraction Operator performs subtraction operation. The symbol of subtraction operator is – Example <script> var num1=20; var num2=10; alert(num1-num2); </script> […]

Javascript Different Types of Data Types

In previous chapter, we have learned by using identifier “var” we declare variable. By using assignment operator we assign data to the declared variable. Unlike Java, .Net, C# we do not require keyword to define the datatype. Javascript compiler can understand the datatype from the assigned value. Now the question is, what kind of data […]

Javascript Variable Declaration

Variables are essential for data storing in memory and utilising as per requirement. Variable is a container. In this container we can store data. Variable Declaration To declare a variable in javascript, we use identifier “var” followed with a name. Alike any programming language such as java, .net, c# etc. the statement must end with […]

What does notice: Undefined Variable in PHP Scripting mean?

The notice: undefined variable means, as the name it says, the variable is not defined. Notice undefined variable Look at the below code <?php if(!empty($employees_data)){ $employee_phone_number=Get_Employee_Phone_Number(); } echo $employee_phone_number ?> Can you guess, what would be the result? It will show, Notice: undefined variable error. Reason: the variable $employee_phone_number variable is defined inisde the if […]

What is the efficient way to fix notice undefined offset array index in PHP?

Array datatype in php contains different values and these values are fetched using index number. Often dealing with array, we encounter undefined offset. What causes undefined offset notice? Lets understand with the help of an example. Example <?php $fruits=array(“apple”,”orange”,”grape”, “guava”,”mango”); ?>   In the above example, $fruits array contains fruit names. If I want to get […]

Create Table in webpage using PHP Code

The power of PHP is it can easily embed HTML Codes. To create any html elements lets say a table, we can use PHP to create a table. Create Table Using PHP We have to echo out all the table tags and its respective data. Note: If you are looking for a solution to create […]

How to calculate size of an Image using PHP?

One prime approach to implement fast loading webpage is to provide image size that is width and height data to the image tag. It will render fast. Even in Accelerated Mobile Page (AMP) implementation it is mandatory to provide image width and height inside the image tag(amp-img). That’s why we need to calculate the size […]

What is the best way to calculate the size of an Array in PHP?

In some cases we may need to know the number of elements present inside an array. PHP has provided two functions that calculates the total elements present inside an array and returns the value. Count() Function PHP has count function which counts the array size. Example; <? $fruits=array(“orange”,”grape”,”apple”); echo count($fruits); ?> output: 3 sizeOf() function […]

How can we use JSON in PHP Scripting?

JSON in PHP – JSON is not object, not an array or any kind of datastructure. People often misunderstood it. JSON is serialized data. JSON is useful to send data in key value format. JSON – Javascript Object Notation How to use JSON in PHP? Lets understand the usage of json in php files. Example […]

How can we use SQL in PHP Server Side Scripting?

PHP has predefined functions that helps us to use SQL syntax inside a php file. SQL in PHP We can execuate following sql related task. Establish connection with database Syntax mysqli_connect(hostname, username, password, databasename) Example <?php $conn=mysqli_connect(“localhost”,”root”,”password”,”root_database”); if($conn){ echo “connected to database”; }else{ echo “failed to connect to the database check connection parameters”; } ?> […]

PHP Switch Case

If we have more than one tasks to executed depending upon conditions, then in such case we use switch statement in php. Switch To better understand the usage of Switch, lets consider following example. Example print value of the variable. <?php $num=4; if($num==0){ echo “The value of num is 0”; }elseif($num==1){ echo “The value of […]

PHP While Loop

While loop is another best solution to handle tasks that are done in repetition. To better understand while loop you must have good understanding of for loop. Read: PHP For Loop While Loop In the previous chapter, I have mentioned, before using for loop, we must have to answer following three questions. What is the starting […]

PHP For Loop

In some cases we may need to complete a task in loop. To handle such situation, we have for loop in PHP. For Loop Lets begin with an example to understand the need of “for loop” Example Lets print 1 to 10 Solution: <?php $num=1; echo $num.'<br/>’; $num++ // incremented the value by 1 echo $num.'<br/>’; $num++ […]

PHP Assignment Operators

To better understand what is an assignment operator, lets re-think once again how do we declare a variable and set value to it? Read Article: Variable Declaration in PHP Assignment Operator The symbol of assignment operator is = Example <?php $num=100; ?> In the above example, we have declared variable name $num. It holds the value […]

PHP Arithmetic Operators

To perform arithmetic operations PHP has operators that performs the task. Operators Addition Operator As the name says, arithmetic operator performs arithmetic operation. The symbol of addition operator is + Example <?php $num1=10; $num2=20; echo $num1+$num2; ?> Output:30 Subtraction Operator Subtraction Operator performs subtraction operation. The symbol of subtraction operator is – Example <?php $num1=20; $num2=10; echo $num1-$num2; ?> Output: 10 […]

PHP If Else IF Else Statement

Before proceeding further lets first understand why if else if statement requirement came? Lets consider the simple situation, login process. A user is only allowed to access web pages of a website, if the user has logged in with valid credentials. See in the above case, “if” logic is there. Logic for login is as […]

PHP Different Data Types

PHP variables can store different data types. Unlike Java, .Net, C#, In PHP we do not require a keyword to define the data type. PHP engine is designed in a way that it can understand the type of data from the assigned value. So what are the data types which PHP engine understands? PHP Data […]

PHP Variable Declaration

Variables are essential in any coding world. It helps to code more efficiently. Lets see how can we define variables in PHP. PHP Variable Declaration In PHP, any variable name should always begin with a dollar sign ($) followed with a name. The name should not contain space. Example: <?php $fruit_name=”Apple”; $employeeAge=22; $Bike-Mileage=20.02 ?> Note: […]

PHP Single Line Comment and Multi-line Comments

Comments are essential in any coding world. PHP is also providing commenting option. Comments are helpful to include in our script pages, where we can write the purpose of a code.  In PHP we can define single line comments and multiple line comments. Single Line Comments As the name says, these are one line statement. […]

Python Data Types

In one of the previous tutorial, I have discussed about variable declaration. Variable are declared to store values in it. We can store different types of values in a variable. Lets learn in this tutorial, what are the different types of data we can store in a variable. String String data type are the general […]