Tag: tuple
Python : How to unpack list, tuple or dictionary to Function arguments using * & **
In this article we will discuss how to unpack a list, tuple and dictionary to function arguments. Suppose we have a function with 3 parameters i.e. Advertisements def updateStudentDetail(name, phone, address): print(“**********************”) print(“Student Name : “, name) print(“Student phone : “, phone) print(“Student address : “, address) We can call this function and pass three …
Python : How to unpack list, tuple or dictionary to Function arguments using * & **Read More
Python Tuple: Different ways to create a tuple and Iterate over it
In this article we will discuss what is tuple, how its different from list, different ways to create a tuple and iterate over it. What is a tuple ? Tuple is a kind of heterogeneous sequential container that can store elements of different types. Tuples are immutable i.e once created then we can not change …
Python Tuple: Different ways to create a tuple and Iterate over itRead More
Python : How to find an element in Tuple by value
In this article we will discuss different ways to check if an element exists in tuple or not. If yes then also find its index and occurrence count. Find an element in tuple by value using ‘in’ & ‘not in’ Python provides operator in and not in to check if an element exists in tuple. …
Python Tuple : Append , Insert , Modify & delete elements in Tuple
In this article we will discuss how to Append, Insert, Replace and Delete elements from a tuple in python. In Python, tuples are immutable i.e. once created we can not change its contents.  But sometimes we want to modify the existing tuple, in that case we need to create a new tuple with updated elements only …
Python Tuple : Append , Insert , Modify & delete elements in TupleRead More
np.array() : Create Numpy Array from list, tuple or list of lists in Python
In this article we will discuss how to create a Numpy Array from a sequence like list or tuple etc. Also, how to create a 2D numpy Numpy Array from nested sequence like lists of lists. np.array() – Creating 1D / 2D Numpy Arrays from lists & tuples in Python To install the python’s numpy module …
np.array() : Create Numpy Array from list, tuple or list of lists in PythonRead More