Python extend tuple | Example code

There’s no append() or extend() method for tuples in Python. Tuples are immutable data types so you can’t remove the element from it. However, you can extend the tuple using concatenate or slice method. Python extend tuple example Simple example code to will not extend tuple but form new tuples: Concatenate tuples Output: Using slice Read More…


Python set extend | Example code

Unlike list extend(), there is no extend function in the Python set. However, you can use Union, Intersection, Difference, or Symmetric difference method to extend the set in Python. Read: Python set union method Python intersection of two sets Python set difference method Python Set symmetric difference Method Python set extend example Simple example code Read More…