Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint
Cover Image
Cover Image
Drag to reposition
Contributed Answers

Python program to count the elements in a list until an element is a Tuple?

Answered on 26th Sep, 2018, 0 Views

A is a given list. This list has nested tuples. Our task is to count the elements in a list until an element is a tuple. Here we use isinstance() function. This function has two parameters object and classinfo.object is to be checked and classinfo is class, type or tuple of class and types. This function returns true if the object is an instance or subclass of as class, or any element of th.....

Python program to check whether two lists are circularly identical

Answered on 26th Sep, 2018, 0 Views

Here two lists are given. Our task is to check and found weather two given lists are circularly identical or not. , True as when these elements in the list will circularly rotate then they would be similar to other given list , , ,

Python program to convert a list of tuples into Dictionary

Answered on 26th Sep, 2018, 0 Views

Here one tuple is given, our task is to convert tuples to dictionary. To solve this problem we use the dictionary method setdefault (). This method has two parameter, to convert the first parameter to key and the second to the value of the dictionary. Setdefault (key, value) is a function searches for a key and displays its value. , , , ,

Python program to sort a tuple by its float element

Answered on 26th Sep, 2018, 0 Views

In this problem, our task to sort a tuple (consisting of float elements) using its float elements. Here we use built-in method sorted () and how can this be done using in place method of sorting. , , , ,

Python program to find k'th smallest element in a 2D array

Answered on 26th Sep, 2018, 0 Views

One n×n user input integer matrix is given and the value of k. Our task is to find out k'th smallest element in a 2D array. Here we use heapq mudule.Heap queue (or heapq) in Python. In Python, it is available using “heapq” module. The technique of this module in python is that each time the smallest of heap element is popped (min heap).nsmallest () method is used to get n.....

Python program to convert an array to an ordinary list with the same items

Answered on 26th Sep, 2018, 0 Views

The array is given. Our task is to convert an array to an ordinary list. We solve this problem with the help of tolist() function. This function return the array as a (possibly nested) list. , , ,

How to convert HTML to PDF using Python

Answered on 26th Sep, 2018, 0 Views

Python provides Pdfcrowd API v2 which is convert HTML documents to PDF. This API is very easy to use and the integration takes only a couple of lines of code. , Conversion will be completed in following 3 Steps from Webpage/HTML to PDF Step 1 − Download the library pdfkit , Step 2 − Now download wkhtmltopdf For Ubuntu/Debian − , For Windows − , Step 3 &min.....

How to parse JSON in Java?

Answered on 30th Aug, 2018, 0 Views

This articles covers how to encode and decode JSON objects using Java programming language. Let's start with preparing the environment to start our programming with Java for JSON. Before you start with encoding and decoding JSON using Java, you need to install any of the JSON modules available. For this tutorial we have downloaded and installed JSON.simple and have added the location of j.....

How to measure the time taken by a function in Java?

Answered on 30th Aug, 2018, 0 Views

java.lang.System.currentTimeMillis() method can be used to compute the time taken by a function in java. Trick is simple. Get the before time and after time using currentTimeMillis() where before time is the time when method is invoked and after time is when method has executed. See the example below − Live Demo , ,

How is Java strictly pass by value?

Answered on 30th Aug, 2018, 0 Views

Call by Value means calling a method with a parameter as value. Through this, the argument value is passed to the parameter. While Call by Reference means calling a method with a parameter as a reference. Through this, the argument reference is passed to the parameter. In call by value, the modification done to the parameter passed does not reflect in the caller's scope while in the call .....

Previous 1 ... 3 4 5 6 7 8 9 ... 16 Next
loader
Advertisements
Contribution

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.