Pavitra has Published 239 Answers

Mathematical Functions in Python - Special Functions and Constants

Pavitra

Pavitra

Updated on 03-Jul-2020 07:59:03

In this article, we will learn about special functions and constants available in the math module in the Python Standard Library.Here we will discuss some constants like −pieinfNantauAnd some functions likeGammaIsinfIsnanisfinite()erf()Let's discuss constants and their respective values −pi3.141592…..e2.718281…...inf6.283185…...nan<infinty>tau<not a number>Now let’s discuss some special functions and their implementation −Gamma − ... Read More

Intersection() function Python

Pavitra

Pavitra

Updated on 03-Jul-2020 07:54:35

In this article, we will learn about intersection() function that can be performed on any given set. According to mathematics intersection means finding out common elements from the two sets.Syntax<set name>.intersection(<set a1> <set a2> ……..)Return Value common elements in sets passed as arguments.Exampleset_1 = {'t', 'u', 't', 'o', 'r', 'i', 'a', ... Read More

isdisjoint() function in Python

Pavitra

Pavitra

Updated on 03-Jul-2020 07:53:20

In this article, we will learn about how we can implement isdisjoint() function on set() data type. This function checks whether the sets passed as arguments have any element in common . In case any element is found, False is returned and True otherwise.The isdisjoint() function can take lists, tuples ... Read More

isupper(), islower(), lower(), upper() in Python and their applications

Pavitra

Pavitra

Updated on 03-Jul-2020 07:51:06

In this article, we will learn about isupper(), islower() ,upper() , lower() function in Python 3.x. or earlier.These are the functions that can be used on strings and related types. They are included in Python Standard Library.All the functions accept no arguments. The isupper() & islower() return boolean values whereas ... Read More

List Methods in Python - in, not in, len(), min(), max()

Pavitra

Pavitra

Updated on 01-Jul-2020 07:19:09

In this article, we will learn about various types of list methods available to us in Python 3.x. Or earlier. These operators allow us to perform the basic operations on the list content.In & Not in operators“in” operator  − This operator is used to check whether an element is present ... Read More

Iterate over a dictionary in Python

Pavitra

Pavitra

Updated on 01-Jul-2020 07:15:00

In this article, we will learn about iteration/traversal of a dictionary in Python 3.x. Or earlier.A dictionary is an unordered sequence of key-value pairs. Indices can be of any immutable type and are called keys. This is also specified within curly braces.Method 1 − Using iterables directlyExampledict_inp = {'t':'u', 't':'o', ... Read More

Iterate over a list in Python

Pavitra

Pavitra

Updated on 01-Jul-2020 07:13:07

In this article, we will learn about iterating/traversing over a list in Python 3.x. Or earlier.A list is an ordered sequence of elements. It is a non-scalar data structure and mutable in nature. A list can contain distinct data types in contrast to arrays storing elements belonging to the same ... Read More

Iterate over a set in Python

Pavitra

Pavitra

Updated on 01-Jul-2020 07:11:50

In this article, we will learn about iterating/traversing over a set in Python 3.x. Or Earlier.It is an unordered collection of objects without any duplicates. This can be done by enclosing all the elements within curly braces. We can also form sets by using type casting via a keyword “set”.Method ... Read More

Iterate over characters of a string in Python

Pavitra

Pavitra

Updated on 01-Jul-2020 07:10:14

In this article, we will learn about iterating/ traversing over characters of a string in Python 3.x. Or earlier.The string is a collection of characters which may contain spaces, alphabets or integers. They can be accessed using indexes or via references . Some commonly implemented methods are shown below.Method 1 ... Read More

issubset()-in-python

Pavitra

Pavitra

Updated on 01-Jul-2020 07:08:00

In this article, we will learn the implementation and usage of issubset() function available in the Python Standard LIbrary.The issubset() method returns boolean True when all elements of a set are present in another set (passed as an argument) otherwise, it returns boolean False.In the figure given below B is ... Read More

Advertisements