Append at Front and Remove from Rear in Python

Pradeep Elance
Updated on 02-Jan-2020 09:44:40

245 Views

When using Python for data manipulation we frequently and remove elements from list. There are methods which can do this effectively and python provides those function as part of standard library as well as part of external library. We import the external library and use it for this addition and removal of elements. Below we will see two such approaches.Using + operatorExample Live Demovalues = ['Tue', 'wed', 'Thu', 'Fri', 'Sat', 'Sun'] print("The given list : " ,values) #here the appending value will be added in the front and popping the element from the end. result = ['Mon'] + values[:-1] print("The values ... Read More

ECMAScript 6 Features in Web Browsers

Giri Raju
Updated on 02-Jan-2020 09:41:54

236 Views

The full form of ECMA is European Computer Manufacturer's Association. ECMAScript is a Standard for scripting languages such as JavaScript, JScript, etc. It is a trademark scripting language specification. JavaScript is a language based on ECMAScript. A standard for scripting languages like JavaScript, JScript is ECMAScript. JavaScript is considered as one of the most popular implementations of ECMAScript.ECMAScript 6 is working fine on web browsers like Chrome, Microsoft Edge, Safari, etc:90% compatibility – Chrome 80% compatibility - Microsoft Edge54% compatibility – SafariUse ES6 using Babale pre-processor, which cross-compile JavaScript back to ECMAScript 5 compatible code.Here are features of ECMAScript 6:Arrow FunctionsDeclare ... Read More

After Method in Python Tkinter

Pradeep Elance
Updated on 02-Jan-2020 09:38:10

3K+ Views

Tkinter is a python library to make GUIs. It has many built in methods to create and manipulate GUI windows and other widgets to show the data and GUI events. In this article we will see how the after method is used in a Tkinter GUI.Syntax.after(delay, FuncName=FuncName) This method calls the function FuncName after the given delay in milisecondDisplaying WidgetHere we make a frame to display a list of words randomly. We use the random library along with the after method to call a function displaying a given list of text in a random manner.Exampleimport random from tkinter import * ... Read More

Add a Chartsheet in an Excel Sheet Using Python XlsxWriter Module

Pradeep Elance
Updated on 02-Jan-2020 09:34:40

484 Views

In addition to python’s own libraries, there are many external libraries created by individual authors which do a great job of creating additional features in python. Xlsx library is one such library which not only creates excel files containing data from python programs but also creates charts.Creating Pie ChartIn the below example we will create a pie chart using the xlsxwriter writer. Here we first define a workbook then add a worksheet to it in the next step we define the data and decide on the columns where the data will be stored in an excel file based on those ... Read More

Add Element to Python List Using Indexing

Pradeep Elance
Updated on 02-Jan-2020 09:32:17

213 Views

A python list is a collection data type that is ordered and changeable. Also, it allows duplicate members. It is the most frequently used collection data type used in Python programs. We will see how we can add an element to a list using the index feature.But before adding the element in an existing link, let's access the elements in a list using the index feature.Accessing List using Indexevery element in the list is associated with an index and that is how the elements remain ordered. We can access the elements by looping through the indexes. The below program prints ... Read More

Add Similar Value Multiple Times in a Python List

Pradeep Elance
Updated on 02-Jan-2020 09:29:58

7K+ Views

There are occasions when we need to show the same number or string multiple times in a list. We may also generate these numbers or strings for the purpose of some calculations. Python provides some inbuilt functions which can help us achieve this.Using *This is the most used method. Here we use the * operator which will create a repetition of the characters which are mentioned before the operator.Example Live Demogiven_value ='Hello! ' repeated_value = 5*given_value print(repeated_value)Running the above code gives us the following result:Hello! Hello! Hello! Hello! Hello!Using repeatThe itertools module provides repeat function. This function takes the repeatable string ... Read More

Real ECMAScript Implementation: Fact or Fiction?

varma
Updated on 02-Jan-2020 09:03:25

303 Views

ECMAScript is a standard for JavaScript implementation. You cannot run or download ECMAScript. JavaScript 2.0 conforms to Edition 5 of the ECMAScript standard, and the difference between the two is minor.The 8th edition, known as ECMAScript 2017, came in June 2017. ECMAScript is a Standard for scripting languages such as JavaScript, JScript, etc. It is a trademark scripting language specification. JavaScript is a language based on ECMAScript. A standard for scripting languages like JavaScript, JScript is ECMAScript. JavaScript is considered as one of the most popular implementations of ECMAScript.The ECMA-262 Specification defined a standard version of the core JavaScript language.JavaScript ... Read More

Difference Between Call and Apply in JavaScript

varun
Updated on 02-Jan-2020 09:02:51

363 Views

In JavaScript, .call and .apply are considered a method of function object..call methodCount the number of arguments with call method. It accepts one or more arguments as objects.Here’s the syntax:.call(object, “argument1”, “argument2”);.apply method To use an array as an argument, use .apply. It requires an array as its 2nd argument.Here’s the syntax:.apply(object, [“argument1”, “argument[]”]);ExampleLet’s see an example showing both call and apply method:                                 var p = {                q: "Hello"             } ... Read More

Get Current Date in JavaScript

usharani
Updated on 02-Jan-2020 08:39:53

1K+ Views

To get the current date in JavaScript, use the getDate() method.ExampleYou can try to run the following code get the date:           Today's Date       Get Date                         function myFunction() {              var date = new Date();              var n = date.getDate();              document.getElementById("test").innerHTML = n;           }            

JavaScript Language Resources

mkotla
Updated on 02-Jan-2020 08:27:18

224 Views

JavaScript resources include resources for the scripting languages standard ECMAScript.This is standardized in the ECMA-262 and ECMA-402 specifications.Here is the ECMAScript standard for the current editions:ECMA-2629th Edition - This is ECMAScript 2018 Language Specification.ECMA-402 5th Edition - This is ECMAScript 2018 Internationalization API Specification.Here are the ECMAScript standards for historical editions:ECMA-262 7th Edition - ECMAScript 2016 Language Specification.ECMA-402 3rd Edition - ECMAScript 2016 Internationalization API SpecificationECMA-262 8th Edition - ECMAScript 2017 Language Specification ECMA-402 4th Edition - ECMAScript 2017 Internationalization API Specification

Advertisements