AmitDiwan has Published 10744 Articles

Pairwise Addition in Tuples in Python

AmitDiwan

AmitDiwan

Updated on 11-Mar-2021 09:22:09

457 Views

If it is required to perform pairwise addition in tuples, then the 'zip' method, the 'tuple' method and a generator expression can be used.The zip method takes iterables, aggregates them into a tuple, and returns it as the result.Generator is a simple way of creating iterators. It automatically implements a ... Read More

Modulo of tuple elements in Python

AmitDiwan

AmitDiwan

Updated on 11-Mar-2021 09:21:52

642 Views

If the modulo of tuple elements is required to be determined, the 'zip' method and a generator expression can be used.Generator is a simple way of creating iterators. It automatically implements a class with '__iter__()' and '__next__()' methods and keeps track of the internal states, as well as raises 'StopIteration' ... Read More

Rear element extraction from list of tuples records in Python

AmitDiwan

AmitDiwan

Updated on 11-Mar-2021 09:17:06

1K+ Views

If it is required to extract the rear element from a list of tuples, it can be done using list comprehension and negative indexing.The list comprehension is a shorthand to iterate through the list and perform operations on it.A list can be used to store heterogeneous values (i.e data of ... Read More

Index minimum value Record in Python

AmitDiwan

AmitDiwan

Updated on 11-Mar-2021 09:11:08

229 Views

If it is required to find the tuple corresponding to the minimum value of other tuple index, it can be done using the 'min' method, and the 'operator.itemgetter' method.The 'min' method gives the minimum of the elements in the iterable. The itemgetter fetches a specific item from its operand.Below is ... Read More

Cummulative Nested Tuple Column Product in Python

AmitDiwan

AmitDiwan

Updated on 11-Mar-2021 09:10:18

225 Views

If it is required to find the cumulative column product of a nested tuple, the 'zip' method and a nested generator expression can be used.Generator is a simple way of creating iterators. It automatically implements a class with '__iter__()' and '__next__()' methods and keeps track of the internal states, as ... Read More

Maximum value in record list as tuple attribute in Python

AmitDiwan

AmitDiwan

Updated on 11-Mar-2021 09:09:57

240 Views

When it is required to find the maximum value in a record list of tuples, the list comprehension and the 'max' methods can be used.A list can be used to store heterogeneous values (i.e data of any data type like integer, floating point, strings, and so on).A list of tuple ... Read More

Python program to sort a list of tuples alphabetically

AmitDiwan

AmitDiwan

Updated on 11-Mar-2021 09:09:39

2K+ Views

When it is required to sort a list of tuples in alphabetical order, the 'sort' method can be used. When using this, the contents of the original tuple get changed, since in-place sorting is performed.The 'sort' function sorts the values in ascending order by default. If the order of sorting ... Read More

Kth Column Product in Tuple List in Python

AmitDiwan

AmitDiwan

Updated on 11-Mar-2021 09:05:42

225 Views

When it is required to find the 'K'th column product in a list of tuple, a simple list comprehension and a loop can be used.A tuple is an immutable data type. It means, values once defined can't be changed by accessing their index elements. If we try to change the ... Read More

Remove nested records from tuple in Python

AmitDiwan

AmitDiwan

Updated on 11-Mar-2021 09:05:14

351 Views

When it is required to remove nested record/tuples from a tuple of tuple, a simple loop and the 'isinstance' method and the enumerate method can be used.The enumerate method adds a counter to the given iterable, and returns it. The 'isinstance' method checks to see if a given parameter belong ... Read More

What Is the Default MySQL Port Number?

AmitDiwan

AmitDiwan

Updated on 10-Mar-2021 13:09:00

1K+ Views

MySQL uses port number 3306 by default.3306 Port Number3306 port number is used by MySQL protocol to connect with the MySQL clients and utilities such as ‘mysqldump’. It is a TCP, i.e Transmission Control Protocol.VulnerabilitiesLet us see if there are any vulnerabilities while using this default port −In general, port ... Read More

Advertisements