There are plenty chances you may have landed in a situation where the code is not behaving as you have expected and you may want to check the python version that is running behind the Jupyter notebook. Then following is the code you must have to use to find out the python version. # see […]
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 Single Line Comment and Multi Line comments
Comments are helpful in any programming. It helps to create hints for the certain way of coding in a programming script. Comments have no influence or impact on any part of coding. And it is purely meant as reading text in any scripting code page. Single line Comment If you are familiar with any other […]
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 Insert an Image into the Web Page
In so many cases, we may need to add image to our HTML webpages. Why image? Because 1000 words would fail to deliver a meaning than a single image. Images make webpages more attractive. IMG Tag How to insert image in html webpage? Solution Using IMG tag we can insert image in to a webpage. […]
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 Single Line Comment and Multiline Comments
Comments help us to keep note inside the script file which later on helps the coder what are the actual purpose of the code. What is a comment in Javascript? In javascript, comment is a hint text or note text a developer or coder include in the script file, so that it would help him […]
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 […]
Javascript An Introduction Tutorial for absolute Beginners
Javascript is a scripting language. Browser engine such as Chrome, Safari, Opera, Firefox etc. compile and runs javascript code. Javascript (JS) Javascript which is also denoted as JS is a client side scripting language. Which means, when ever we want client side data validation then only we should use javascript code. Example: If we want […]
What are the basic differences between Server Side Scripting(PHP) and Client Side Scripting(Javascript)?
Server side scripting as the name says, the scripts meant for server and client side scripting means the script meant for client. What is sever? To run a website, we must have to keep all the files related to the site at a specific location. This location is called server. Server contains all the files […]
Simple fix for Header already sent error in PHP Scripting
While setting header information we often encounter this error: header already sent and we could not able to figure out exactly what is the error and how to solve it. Headers Already Sent Error First of all we have to understand why this error is rising. Reason When ever we run a php script, along […]
Why do web developers prefer MySQLi over MySQL in PHP Scripting?
Professionals, php Gurus and developers strictly suggest to use mysqli functions in php script. But while developing php application we have witnessed mysql function is working fine in script with latest version of php. Then why we should we go for mysqli functions. MySQL functions in PHP mysql functions in php are the old functions […]
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 simplest approach to prevent SQL Injection in PHP Scripting?
Hackers follow sql injection to inject virus, delete data, collect data, change data etc. SQL Injection Hackers keep looking for the loop holes present in a website. Best target points are input fields. Such as login forms which has input fields. With the help of computer program, they find out the vulnerable points. Once they […]
What is the PHP function for obtaining current URL of the web page?
In some cases, we may need to get the current url of the webpage. PHP has super global variables which holds the data related to the webpage url. $_SERVER super global variable PHP has this variable $_SERVER it contains all the web url related info. We need to get two data, one is request uri, […]
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 […]
What is the purpose of $_GET in PHP Scripting?
$_GET variable is used in php to collect data that is passed through url. The general case where we use get in a php is during form submission. Form submission sends various data as parameter in the url. At the recipient php file, the data present in the variable is collected. How to use Get […]
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”; } ?> […]
How can we convert a string value into an Array using PHP?
In php, a string can be converted into an array. PHP has a predefined function explode, which breaks string text into array. String to Array Conversion To convert a string into array lets use php function “Explode” Syntax explode(seperator, string); Note: While converting a string into an Array by using explode php function, keep one […]
PHP: How to convert an Array into a string?
In some cases, we may want to convert an array into a string. There are plenty ways we can achieve the result. Lets learn about most effective ones. Convert An Array To String We can convert an array into a string in following two ways. First one – implement our own logic and second one – to […]
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 […]