Skip to main content

Featured

What is Coroutine in Android?

Coroutines are available for the Kotlin language. Coroutines are simply cooperative functions.   Our Android applications often have multiple concurrent and interdependent functionalities. We provide instructions to the system through code, also known as a program, to perform a set of sequential instructions.  During the execution of these instructions, a specific instruction may take longer than expected, causing the next line of code to wait until the previous line of code has completed its execution. This scenario is known as blocking program execution. To avoid blocking program execution, the code must be executed on a separate thread. A thread is a single sequential flow of control. However, creating and handling multiple threads can be difficult and expensive in terms of OS operations and memory usage. To address this issue, we can use Coroutines in Kotlin. Coroutines are cooperative functions that are executed on threads as needed in a cooperative manner. They help manage long-r

Tuple Functions in Python


Hello All ,
In this Post I am going to list some useful function of tuple in python.
Tuple is immutable in python so we can't have many functions to work with tuple in python. Here are some useful functions for tuple in python.

Functions :
1.len()
2.max()
3.min()

1. len() :
This function is used for finding length of tuple.

myTuple = (1,2,3,4,5)
print(len(myTuple))

#Output
#5

2.max() :
max() function return maximum value from defined tuple in python.

myTuple = (1,2,3,4,5)
print(max(myTuple))

#Output
#5

3.min() :
min() function gives us minimum value from given tuple in python.

myTuple = (1,2,3,4,5)
print(min(myTuple))

#Output
#1

Comments

Popular Posts